summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
AgeCommit message (Collapse)Author
2012-11-21Disable the stack protector in OVERRIDE_OPTIONS for the time being. The stackMiod Vallat
protector code will conflict with the way variadic functions spill the registers on the stack, causing the latter to be partially overwritten with the value of __guard. Core dumps and hilarity ensues. This can probably be fixed by changing the time registers are spilled from the backend for __builtin_expand_saveregs(), to setup_incoming_varargs(), as done on e.g. rs6000. But that's far from a trivial change, and I'd like to be able to exercize gcc 3 a bit more on m88k before sacrificing more brain cells to the gcc evil deities.
2012-11-21Remove an md global which value is a duplicate of MI current_function_args_info.Miod Vallat
No functional change.
2012-11-21Turn OVERRIDE_OPTIONS into a function, will make it easier to extend on aMiod Vallat
per-platform basis.
2012-11-20Convert to new world order by defining TARGET_OS_CPP_BUILTINS instead ofMiod Vallat
CPP_PREDEFINES; try to deuglify CPP_SPEC whenever possible as well.
2012-11-20Make the mips and powerpc optimizer bug workarounds permanent (i.e. applyMiod Vallat
them to all platforms). Both of them had been added very late in a release cycle, which caused us to prefer workarounds with minimal side effects. Since the issue they are avoiding may happen on other platforms, there is no harm in making sure no other platform gets bitten by them. And at the moment no supported platform runs gcc 3, so this does not cause any regression.
2012-11-19Make sure to invoke end_sequence() before passing it to any emit_insn()Miod Vallat
flavour. From etoh@'s gcc 3.4 tree. While there, also kill change_arg_use_of_insns_2() which is now a dim wrapper around change_arg_use_of_insns(), from etoh@'s tree as well.
2012-11-19move_by_pieces_1(), store_by_pieces_2(): sync insn skipping logic in theMiod Vallat
predecrement cases with gcc 2.95. This had been needed for m68k but somehow etoh@ missed this when porting the gcc 2.95 fixes back to its 3.3, then 3.4 tree. This fixes passing of struct by value on m68k, and lets gcc 3 reliably bootstrap itself now.
2012-11-19Sprinkle TREE_SIDE_EFFECTS annotations around all the computations done inMiod Vallat
va_arg(). __vfprintf() still unhappy in some edge cases I am investigating.
2012-11-17Revert the va_start() and va_arg() optimization for functions which have noMiod Vallat
variadic arguments passed in registers: these functions may pass a va_list to another function, which will then need to rely upon a properly filled __va_list struct and can't assume anything about the way arguments have been passed to its caller.
2012-11-17In the expansion of __builtin_saveregs(), use double store instructions toMiod Vallat
spill the registers on __va_reg instead of calling move_block_from_reg().
2012-11-16In SETUP_INCOMING_VARARGS(), make sure to return in pretend_size the amountMiod Vallat
of memory which will be used for the __va_reg register spill.
2012-11-16Rewrite the varags implementation again (third time's the charm), the upstreamMiod Vallat
varagrs implementation being utterly wrong. This is the same logic as the one I wrote for gcc 2.95, with a few more optimizations whenever possible (such as not outputting instructions to fill fields of the __va_list struct we know won't be accessed, now that we have total control of the struct in the compiler). It should now be possible to mix varags code compiled by gcc 2.95, with code compiled with gcc 3, with the following exception: as I have finally found and fixed the buglet causing all arguments to be passed on the stack if any of the named arguments (before varargs) is a struct of 32 bytes or more passed by value, such a (pretty uncommon) case will not be interoperable. One such case can be found as va-arg-4.c in gcc's testsuite. With these changes, all the following varargs exercizers from gcc's testsuite now pass when compiled with the in-tree gcc 3: gcc.c-torture/execute/920625-1.c gcc.c-torture/execute/931004-10.c gcc.c-torture/execute/931004-12.c gcc.c-torture/execute/931004-14.c gcc.c-torture/execute/931004-4.c gcc.c-torture/execute/931004-6.c gcc.c-torture/execute/931004-8.c gcc.c-torture/execute/strct-varg-2.c gcc.c-torture/execute/va-arg-1.c gcc.c-torture/execute/va-arg-2.c gcc.c-torture/execute/va-arg-4.c gcc.c-torture/execute/va-arg-5.c gcc.c-torture/execute/va-arg-6.c as well as the few others of my own I had been using while working on gcc 2.95 more than 8 years ago.
2012-11-15Only allow the "return" insn construct (which simply yields a "jmp r1" line)Miod Vallat
if null_prologue(), i.e. if there is no stack frame to undo and no r1 to restore. Make the "epilogue" insn construct no longer depend on "return", but rather on "(use (const_int 0))" as "prologue" and as generally done on other backends. On the other hand, make it unconditionnal, instead of "! null_prologue()". These changes make sure than a leaf procedure call does not end up "returning" (i.e. jmp r1) upon return from the call, without restoring r1 and r30 (whenever applicable) from the existing stack frame. This makes a gcc3-compiled __main() (from libgcc2.c) no longer spin after invoking the constructors, and gives the real payload (i.e. main() and whatever follows from there) a chance to run.
2012-11-15Make this cross-compile friendly by defining ATTRIBUTE_UNUSED to an emptyMiod Vallat
string if not defined already, when cross-compiling. (curse words censored)
2012-11-14Do not bother reloading r1 from the stack in the epilogue, if it has not beenMiod Vallat
clobbered (e.g. in leaf functions). While saving it helps debugging, reading it back is just useless in that case.
2012-11-14Generously sprinkle RTX_FRAME_RELATED_P() in the prologue and epilogue code,Miod Vallat
as recommended by the documentation. I have not seen a difference in the generated code so far, but I'd rather play safe at the moment.
2012-11-14Define EPILOGUE_USES(). And suddenly the life analysis pass doesn't decideMiod Vallat
reloading the return address register from the stack in the epilogue isn't a useless operation anymore.
2012-11-14Revert the `sequence' part of 1.3 - it is actually not necessary and hidesMiod Vallat
other problems by making the optimizer more eager to optimize out the whole prologue and epilogue away in some cases.
2012-11-11The next step towards a working gcc3/m88k: remove the argument area (from gcc2),Miod Vallat
and try to get the builtin varargs code to work. I have tried to mimic the gcc2 varargs logic, which is optimal in the sense that no argument gets duplicated and as many arguments as possible are passed in registers, to no avail (read: hair-pulling ICE out of nowhere in variadic functions). So I am now sticking to the original gcc 2.7 varargs, where an argument passed on the stack consumes the registers it would have been passed as, if its type would have allowed it. This spills too much memory on the stack, but on the other hand makes the expansion of va_arg() much simpler. This means that, should gcc3 on m88k platforms be solid enough, mixing varargs objects compiled with gcc 2 and gcc 3 will not be possible. But we're not there yet.
2012-11-11Explicitely include <nlist.h> if !__ELF__ for this file to compile.Miod Vallat
2012-11-11Recognize "uahalf" and "uaword" statement, as synonyms for "half" and "word"Miod Vallat
(the a.out assembler doesn't enforce alignment for "half" and "word" data). Needed because gcc 3 will produce such statements.
2012-11-09Doh, in gcc3 the various *_ASM_OP need to output explicit whitespace beforeMiod Vallat
and after the keyword.
2012-11-09Move the actual operand contraints in define_split constructs from the lispMiod Vallat
expression attributes to the conditional C statement chunk, for this is the only way to have them honored with gcc 3 (thanks for genrecog to warn about this). Note that most of the affected operands were ``register_operand'', hence the "r" constraint is implied. There are a few `register + ccmode' constructs which could have caused wrong code generation before this change, though.
2012-11-09Put prologue and epilogue instructions into their own sequences, bounded byMiod Vallat
``insn deleted'' notes. This prevents the optimizer from chewing too far.
2012-11-09(subreg) in gcc 3 takes the subreg position in bytes, not in BYTES_PER_WORDMiod Vallat
units.
2012-11-09Port the gcc 2.95 m88k fixes to the gcc 3 codebase, except for the functionMiod Vallat
frame setup and varargs handling, which need some more work at the moment.
2012-11-09Allow OBSD_HAS_CORRECT_ASM_OPS to prevent <openbsd.h> from redefining theMiod Vallat
.type, .size, .set and .globl stanzas, similar to openbsd.h r1.9 in gcc 2.95
2012-11-05Backport a powerpc --relax fix present in binutils 2.17.Landry Breuil
This allows mozilla trunk to finally link again on ppc (with --relax), otherwise it fails badly with relocations overflow. From http://sourceware.org/ml/binutils/2005-01/msg00115.html ok kettenis@, no objection miod@
2012-11-04Less pessimistic OPT value for m68k.Miod Vallat
2012-10-26Fix for CVE-2012-5195; ok miod@Todd C. Miller
2012-10-18Add support for stac/clac instructions to manipulate the flagJonathan Gray
that controls the behaviour of Intel's Supervisor Mode Access Prevention (SMAP) feature. 'looks correct' miod@ ok deraadt@
2012-10-13fix typo, keyword is exists, not existMarc Espie
2012-10-02fix weird depend on -liberty, okay miod@.Marc Espie
maybe not the simplest fix, but I'd rather it gets fixed now, while we discuss details :)
2012-09-16Build gcc as non-PIE. PIE breaks precompiled headers and causes a seriousMark Kettenis
performance hit on some architectures (almost 20% on hppa, more than 25% on sparc64). And there are no real benefits associated with ASLR for a compiler. ok deraadt@
2012-09-07disassemble the rdrand instruction on i386/amd64Christian Weisgerber
2012-09-03Teach as(1) about rdrand on i386/amd64.Mark Kettenis
ok jsg@
2012-09-01Clean up the correct file to fix parallel make failuresPhilip Guenthe
ok deraadt@
2012-09-01Fix typo in comment: s/PT_OPENBSD_RANDOMDATA/PT_OPENBSD_RANDOMIZE/Matthew Dempsky
2012-09-01don't pollute the src dir with info pages when doing buildsJonathan Gray
ok kettenis@ deraadt@
2012-08-31Add a DT_DEBUG tag to PIEs as well.Mark Kettenis
ok pascal@
2012-08-31Sync vestigial in-tree GCC 3 specs with recent GCC 4 changes.Matthew Dempsky
From Brad.
2012-08-31No longer create lib*_pic.a files. Nothing uses them anymore.Theo de Raadt
grep help from sthen; discussion with brad ok guenther pascal
2012-08-29Add DWARF2 CFI unwinder for hppa.Mark Kettenis
2012-08-29Adjust for changes to "struct reg".Mark Kettenis
2012-08-28Add support for PIE-by-default in both ld and gcc. This is a completelyPascal Stumpf
different approach than the one taken in kurt@'s original diff, but deemed better after discussion and diff exchange with kettenis@ and matthew@. Lots of feedback by kettenis@ and matthew@, prodding and encouragement by deraadt@. ok kettenis@ matthew@
2012-08-28Work around -Wbounded warning by using sizeof(x_fname), not FILNMLEN. ThePascal Stumpf
latter gets defined incorrectly (too small) because of include ordering issues. Same fix as for binutils-2.17. Noticed by deraadt@. ok matthew@
2012-08-22recognise rrx mnemonic, from GPLv2 apple cctools via FreeBSDJonathan Gray
ok miod@
2012-08-22Bring in a change from post 2.17 (but still GPLv2) binutilsJonathan Gray
to avoid BFD64 host ifdefs in 32 bit only sparc targets. elfxx-sparc.c 1.31 and elfxx-sparc.h 1.8 Needed to compile sparc from a 64 bit host. ok miod@
2012-08-22make this compile by adapting loongson changes to the 2.17 struct layoutJonathan Gray
ok miod@ matthew@
2012-08-22add a file from 2.17 which was omitted when imported but needed for mips64Jonathan Gray
ok miod@ matthew@