Bug 16624 - [4.0 regression] [arm] segmentation fault on float accesses in the ?: operators' body
Summary: [4.0 regression] [arm] segmentation fault on float accesses in the ?: operato...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on: 15068
Blocks:
  Show dependency treegraph
 
Reported: 2004-07-19 08:41 UTC by Gábor Lóki
Modified: 2004-09-13 17:41 UTC (History)
1 user (show)

See Also:
Host:
Target: arm-unknown-linux
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-08-18 15:59:19


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gábor Lóki 2004-07-19 08:41:54 UTC
There is something wrong with the float access when the ?: operators are
used on arm. If the body of the ?: operators contain float variables the
compiler'll drop some errors.

I made several crosscompiler, and I only found that arm-*-linux 
doesn't handle the following c code:

float a;
void foo(float b) {
  a = (b > 0 ? 1  : (b < 0 ? -1 : 0));
}

Command line (arm-linux-gcc (GCC) 3.5.0 20040718):
arm-linux-gcc -c -O1 foo.i

Output:
foo.i: In function `foo':
foo.i:6: internal compiler error: in elim_reg_cond, at flow.c:3244
Comment 1 Andrew Pinski 2004-07-19 18:50:01 UTC
Actually it looks like more optimization before getting to RTL causes this to changed into what the ICE 
is for PR 15068.
Comment 2 Andrew Pinski 2004-08-02 16:54:27 UTC
Can you try this again as PR 15068 is fixed?
Comment 3 Gábor Lóki 2004-08-03 13:35:41 UTC
(In reply to comment #2)
> Can you try this again as PR 15068 is fixed?
Yep. The test case which I sent is fixed, BUT there is another regression. See
the following:

Second test case:
double
foo(double x, double y)
{
  return (x >= 1 ? 0 : 1 - x)/y;
}

Cmd line (2004-08-03 08:00:00 UTC):
arm-linux-gcc -c -O1 -o foo2.o foo2.i

Output:
foo2.i: In function `foo':
foo2.i:5: internal compiler error: in elim_reg_cond, at flow.c:3247
Comment 4 Richard Earnshaw 2004-09-01 10:49:24 UTC
I think I've now fixed all the remaining cases.  Please re-open or refile if you
find any further problems.