The structural and optical properties of three different kinds of GaAs nanowires with 100% zinc-blende structure and with an average of 30% and 70% wurtzite are presented. A variety of shorter and longer segments of zinc-blende or wurtzite crystal phases are observed by transmission electron microscopy in the nanowires. Sharp photoluminescence lines are observed with emission energies tuned from 1.515 eV down to 1.43 eV when the percentage of wurtzite is increased. The downward shift of the emission peaks can be understood by carrier confinement at the interfaces, in quantum wells and in random short period superlattices existent in these nanowires, assuming a staggered band offset between wurtzite and zinc-blende GaAs. The latter is confirmed also by time-resolved measurements. The extremely local nature of these optical transitions is evidenced also by cathodoluminescence measurements. Raman spectroscopy on single wires shows different strain conditions, depending on the wurtzite content which affects also the band alignments. Finally, the occurrence of the two crystallographic phases is discussed in thermodynamic terms.