This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/36182] [4.3 Regression] Fix for PR 36090 causes libstdc++ regressions
- From: "hp at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 May 2008 19:18:23 -0000
- Subject: [Bug rtl-optimization/36182] [4.3 Regression] Fix for PR 36090 causes libstdc++ regressions
- References: <bug-36182-507@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from hp at gcc dot gnu dot org 2008-05-09 19:18 -------
There has been some speculation that the back-ends where the bug
appear are *all* to blame by e.g. having a flawed
GO_IF_LEGITIMATE_ADDRESS. A gdb session shows that the back-end
validation hook that is used for the (CONST (MINUS sym2 sym1))
expression is (naturally when you think of it)
LEGITIMATE_CONSTANT_P. In cases similar to the failure for CRIS,
the flawed expression isn't used in an address-operand so
GO_IF_LEGITIMATE_ADDRESS won't hit.
But, consider the documentation, which recommends defining
LEGITIMATE_CONSTANT_P to 1, which indeed most targets do; very
few actually look inside a CONST, i386 being a notable
exception.
I think that kind of CONST should simply not be generated by gcc
for now, and certainly not on the 4.3 branch.
If this CONST *is* to be generated (on trunk), IMHO some new
constant-expression validation needs to take place in
CONSTANT_P, one where the target can refuse expressions that
aren't valid assembly-code (in this case, for CRIS, sym2-sym1
where sym2 and sym1 are in different sections). Alternatively,
LEGITIMATE_CONSTANT_P redefined in the documentation and most
back-ends.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36182