Age | Commit message (Collapse) | Author |
|
when doing bounds checking (bug revealed by mmap malloc).
Noticed by krause@, tested otto@
|
|
changes address incorrect stack usage, when optimization needs more
nameless temporary values than available registers, and has to save them
on stack.
In some (rare) circumstances, it will compute a stack address _outside_
the current function local storage space, overwriting the caller's stack.
Most of the time, this only affects the "outgoing argument area", which is
harmless if it has not been populated; this explains why it has not been
noticed earlier.
Since I see no easy way to fix this, I decided to go the simpler way of
removing this ougoing argument area. This not only reduces stack usage,
but also makes varargs/stdarg code smaller and faster; also functions which
get their first few arguments in registers, then some on the stack, then
some in registers again, will not allocate stack space for the second
set of arguments passed through registers.
This is an ABI change, we are no longer 88Open compliant (have we ever
been?).
|
|
work for code compiled at -O0...
|
|
knowing that the area we are using is correctly aligned.
Produces smaller and faster code (about 0.8% time decrease in a complete
build, which amounts to roughly 15 minutes).
|
|
for registers if at least one nameless argument is passed through registers;
instead, only allocate as many bytes as necessary.
Slightly reduces stack usage; no ABI change.
|
|
current_function_{stdarg,varargs} instead of homegrown implementation, etc.
No functional change.
|
|
fixes C++ exceptions.
this relies on an earlier libstdc++ bump
|
|
and they have different major numbers to prevent collision.
|
|
To build you must:
cd /usr/src && make obj && make includes
cd lib/libc && make depend && make && NOMAN=1 sudo make install
cd /usr/src && make build
|
|
The problem really only arises when optimize_reg_copy_3() attempts to
merge a load which fits in a register and a load which does not fit - in
the m68k case, merging an int32_t foo and (int64_t)foo two lines later.
In this case, and only if the backend provides its own expansion of the
extendsidi2 insn (usually for performance and code size reasons) as
embedded assembly statements but not rtl operations, then gcc at this
point will ``fail to realize'' that when sign-extending (or
zero-extending) the value of rN into rN and r(N+1), the value of rN is
not preserved on big-endian architectures, and the optimization will
produce bad code.
Of all the OpenBSD-supported platforms, arm and m68k are the only
affected; but further optimizations in gcc3 (on arm) apparently neuter
this bug, which I have been unable to reproduce in an arm build with
gcc3.
This commit works around the problem by preventing expansions larger
than the width of a general register, on m68k only. Other platforms are
not affected.
|
|
|
|
This is a workaround for lines 1055-1057 of tcp_input.c being miscompiled,
though the problem looks like missing use/clobber qualifiers in the
extendplussidi insn, rather than a specific optimize_reg_copy_3() issue.
A proper fix may be devised in the future, in the meantime this allows
m68k platforms to be back in track.
|
|
No functional change, it's just faster.
|
|
and the reload phase when compiling complex code, and the fix is non-trivial.
|
|
|
|
and FUNCTION_ARG_ADVANCE fixes in m88k.c, allow the optimized bcopy
sequences to be reliable again, so enable them back.
|
|
parameter is going to hit the stack.
|
|
__builtin_saveregs(); no functional change.
|
|
ok deraadt@
|
|
pass all the subsequent arguments on the stack.
This is necessary for proper varargs operation, if used.
|
|
|
|
|
|
|
|
* caller-save.c (mark_referenced_regs): Mark partially-overwritten
multi-word registers.
This problem apparently only affected m88k, as far as OpenBSD is concerned.
|
|
ok deraadt@, millert@, krw@ - mdoc ok jmc@
|
|
changed the order of array relocation with the depth first order of variable sco
pe.
ok pvalchev@
|
|
valid base register for indexed addressing, rather than providing an
incomplete inline version.
This allows constructs such as
(plus:SI (reg:SI (subreg:SI (reg:DI 1))))
to properly pass through the reload phase if optimization is enabled.
Such a construct can be generated with
buf[index + index2] = value;
if either index or index2 are long long.
Fixes the ICE in zsh Src/Zle/computil.c.
|
|
comparisons using different operators, make sure to generate an insn
with the correct mode.
This means that constructs like
if (c != -1 & i < 9999)
and
if ((i<=7) | (value != 0))
as found in transfig and teTeX, respectively, will now compile with
optimization.
Note the single & or | in these constructs - this kind is rare enough for
this bug to have remained unnoticed until now...
|
|
few bugs in the 2.95 codebase, one of them being fatal to m88k.
A real fix will come after 3.5.
ok deraadt@
|
|
on mvme88k.
ok deraadt@ espie@
|
|
|
|
ok theo
|
|
|
|
calculate_can_reach_end skips the NOTE_INSN_FUNCTION_END with _ssp_ label to the original NOTE_INSN_FUNCTION_END.
ok otto
|
|
|
|
link libc.
|
|
|
|
|
|
ok markus@ drahn@
|
|
ok deraadt@
|
|
|
|
(all these changes were okay'ed millert@, btw)
|
|
Disable building of cxxfilt in gcc, build it from its own directory.
|
|
|
|
instruments for every functions.
ok pvalchev@
|
|
functions.
ok pvalchev@
|
|
ok pvalchev@
|
|
the contents of DECL_RTL (parms).
ok pvalchev@
|
|
of your beliefs are wrong.
In this case, trust in gcc.
When computing the address of a field in a structure on stack, and:
- the offset of the structure relative to the stack pointer
and
- the offset of the field relative to the structure
have no _bits_ in common (for example, accessing field at structure(8)
with the structure at sp(64)), triggers a gcc optimization in the following
improvement:
(plus (plus (frame_pointer offset_for_structure) offset_for_field))
changing into
(plus (frame_pointer direct_offset_for_field))
In the aforementioned "no bits in common" case, gcc will use
(or (plus frame_pointer offset_for_structure) offset_for_field)
which is not necessarily correct, depending on the value of the frame
pointer...
Checking generated assembly code for a kernel compilation pointed out that
ALL architectures were affected by this bug (some, such as m88k, alpha
and sparc64, being much more affected than others, such as vax and m68k).
Our first move was to backport a fix for this found in the gcc 3.x branch,
however it relies upon several microbugfixes scattered around, and produced
a misbehaving kernel on one particular machine. So what goes in with this
commit is just a conservative fix which disables this particular "bitwise or
is fun" optimization.
Problem discovery and analysis by yours truly. Fix by etoh@ and I.
Tested on all supported architectures by various people, including deraadt@,
henning@, mickey@, naddy@ and I.
|
|
This switch forces block copy operations to always fallback to memcpy()
when it is not done by inline load and stores, rather than using the
m88k movstr* functions found in libgcc.
The name of this option has been choosen after the mips back end, which
has a similar option.
Right now, this is a no-op since these functions are disabled due to (yet)
another gcc bug; but this will help building standalone code, such as the
kernel and boot blocks, without having to link against libgcc.
|