This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/5625] [mips] exception unwinding creates invalid pointer on mips
- From: "rsandifo at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Feb 2004 20:43:00 -0000
- Subject: [Bug libstdc++/5625] [mips] exception unwinding creates invalid pointer on mips
- References: <20020207120601.5625.emaste@sandvine.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rsandifo at redhat dot com 2004-02-05 20:42 -------
Subject: Re: [mips] exception unwinding creates invalid
pointer on mips
"wilson at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
> The MIPS port is the only 64-bit port that I am aware of which sets
> Pmode to SImode when generating ILP32 code. This is arguably a bug in
> the mips port.
And later:
> I was looking at other 64-bit targets like Alpha and IA-64, but it
> occurs to me that MIPS is somewhat different, in that we have a complete
> set of both 32-bit and 64-bit operations (or at least we can pretend
> that we do have them all), and thus maybe an SImode Pmode makes more
> sense for 64-bit ILP32 MIPS than it does for other targets.
Right. The Pmode == ptr_mode thing is deliberate: if you change Pmode
to DImode for 32-bit ptr_mode, then the loop optimisers are no longer
able to recognise ivs properly. Any pointer + integer will involve
a sign-extension.
It was suggested that you can reduce this effect by making PROMOTE_MODE
promote to DImode. But we (well, OK, Eric ;) tried that for mips-rewrite
and it resulted in a chronic loss of performance. This is because we can
only enforce the "SImode registers are sign-extended" rule via
TRULY_NOOP_TRUNCATION. Promoting everything to DImode introduces
a _lot_ of truncations.
FWIW, I like your suggestion of introducing a special builtin-function.
Richard
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5625