This is the mail archive of the
mailing list for the GCC project.
Re: PATCH: PR12308
- From: Caroline Tice <ctice at apple dot com>
- To: Caroline Tice <ctice at apple dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 15 Jan 2004 13:35:25 -0800
- Subject: Re: PATCH: PR12308
- References: <488AFE91-479C-11D8-92BB-000393BB90B6@apple.com>
Oops! I just realized I forgot the ChangeLog; sorry, here it is:
2004-01-15 Caroline Tice <firstname.lastname@example.org>
* config/i386/i386.md (fix_truncxfdi2): Add clause to clobber
On Jan 15, 2004, at 12:49 PM, Caroline Tice wrote:
This patch fixes bug PR12308, which is an i386-specific bug.
The *real* problem is that, in order to do proper mode switching for floating point math
on the x86, optimize_mode_switching ends up creating a new bit of rtl, about two-thirds of the
way through the back end. This new bit of rtl happens to clobber the flags register. It also
happens to be inserted immediately prior to the first "fix" rtl, which is where it is needed.
So far, so good. The problem is that the previous optimizations have been freely moving the
"fix" rtl all over the place since "fix", BY ITSELF, does not clobber anything. But suddenly there's a clobber of the flags register happening immediately prior to the "fix" rtl. This
can be a big problem if the "fix" rtl happens to land between a set and a use of the flags
register, (e.g. between a compare and a conditional jump), which it does for this bug.
The really correct way to fix this problem would be to issue the mode switching rtl at
the same time the "fix" is issued, and to indicate 1). the mode switching rtl clobbers the
flags register, and 2). the "fix" rtl needs the results of the mode switching rtl. That's
pretty messy and complicated. The patch I am offering takes the easier route of
marking the "fix" rtl as clobbering the flags registers.
This patch has been tested on an i386 machine running Linux. It bootstraps and
passes the DejaGnu tests.
Is this okay to commit? If so, where would be the appropriate place to put it?
-- Caroline Tice