public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
@ 2005-11-27 17:39 pinskia at gcc dot gnu dot org
2005-11-27 17:40 ` [Bug c/25125] " pinskia at gcc dot gnu dot org
` (28 more replies)
0 siblings, 29 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-27 17:39 UTC (permalink / raw)
To: gcc-bugs
unsigned short f(unsigned short a)
{
short c = a;
if (c >0) return 0;
short b = ((int)a) + - (int)32768;
return b;
}
int main(void)
{
printf("%d\n", f(32769));
}
---
Compile with -O2 and we get the wrong result. We should get 1 but instead we
get 32768. Note this was exposed by VRP but VRP is doing what it is given o
it.
--
Summary: [4.1/4.2 Regression] (short) ((int)(unsigned short) +
(int)) is done in the wrong type
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug c/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
@ 2005-11-27 17:40 ` pinskia at gcc dot gnu dot org
2005-11-27 17:42 ` pinskia at gcc dot gnu dot org
` (27 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-27 17:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2005-11-27 17:40 -------
I should note I found this while trying to improve fold to a - b to a + -b as
that is valid as far as I can tell.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.1.0 4.2.0
Known to work| |4.0.3
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug c/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
2005-11-27 17:40 ` [Bug c/25125] " pinskia at gcc dot gnu dot org
@ 2005-11-27 17:42 ` pinskia at gcc dot gnu dot org
2005-11-27 17:45 ` rguenth at gcc dot gnu dot org
` (26 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-27 17:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2005-11-27 17:42 -------
I think this is related to PR 19606
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug c/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
2005-11-27 17:40 ` [Bug c/25125] " pinskia at gcc dot gnu dot org
2005-11-27 17:42 ` pinskia at gcc dot gnu dot org
@ 2005-11-27 17:45 ` rguenth at gcc dot gnu dot org
2005-11-27 17:47 ` rguenth at gcc dot gnu dot org
` (25 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-11-27 17:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2005-11-27 17:45 -------
Confirmed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2005-11-27 17:45:30
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug c/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-11-27 17:45 ` rguenth at gcc dot gnu dot org
@ 2005-11-27 17:47 ` rguenth at gcc dot gnu dot org
2005-11-27 18:03 ` [Bug middle-end/25125] " pinskia at gcc dot gnu dot org
` (24 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-11-27 17:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from rguenth at gcc dot gnu dot org 2005-11-27 17:47 -------
g++ has the same problem. We don't have a frontend category, though.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-11-27 17:47 ` rguenth at gcc dot gnu dot org
@ 2005-11-27 18:03 ` pinskia at gcc dot gnu dot org
2005-11-28 21:48 ` janis at gcc dot gnu dot org
` (23 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-27 18:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2005-11-27 18:03 -------
I am going to say that convert.c is part of the middle-end.
The problem is convert.c:570
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|c |middle-end
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-11-27 18:03 ` [Bug middle-end/25125] " pinskia at gcc dot gnu dot org
@ 2005-11-28 21:48 ` janis at gcc dot gnu dot org
2005-12-04 4:21 ` pinskia at gcc dot gnu dot org
` (22 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: janis at gcc dot gnu dot org @ 2005-11-28 21:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from janis at gcc dot gnu dot org 2005-11-28 21:48 -------
A regression hunt identified this large patch of many VPR fixes:
http://gcc.gnu.org/viewcvs?view=rev&rev=100478
r100478 | dnovillo | 2005-06-02 02:57:15 +0000 (Thu, 02 Jun 2005) | 141 lines
--
janis at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dnovillo at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-11-28 21:48 ` janis at gcc dot gnu dot org
@ 2005-12-04 4:21 ` pinskia at gcc dot gnu dot org
2005-12-17 17:26 ` kazu at gcc dot gnu dot org
` (21 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-12-04 4:21 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-12-04 4:21 ` pinskia at gcc dot gnu dot org
@ 2005-12-17 17:26 ` kazu at gcc dot gnu dot org
2005-12-18 15:51 ` steven at gcc dot gnu dot org
` (20 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: kazu at gcc dot gnu dot org @ 2005-12-17 17:26 UTC (permalink / raw)
To: gcc-bugs
--
kazu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |kazu at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-12-17 17:26 ` kazu at gcc dot gnu dot org
@ 2005-12-18 15:51 ` steven at gcc dot gnu dot org
2005-12-19 18:29 ` mmitchel at gcc dot gnu dot org
` (19 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-12-18 15:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from steven at gcc dot gnu dot org 2005-12-18 15:51 -------
Kazu assigned this to himself on December 17, see
http://gcc.gnu.org/ml/gcc-bugs/2005-12/msg01787.html
Folks, please add a comment when you assign a bug to yourself. That way, it's
easier to see which bugs have had someone looking at them recently.
--
steven at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2005-11-27 17:45:30 |2005-12-18 15:51:56
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (8 preceding siblings ...)
2005-12-18 15:51 ` steven at gcc dot gnu dot org
@ 2005-12-19 18:29 ` mmitchel at gcc dot gnu dot org
2005-12-19 18:29 ` mmitchel at gcc dot gnu dot org
` (18 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-12-19 18:29 UTC (permalink / raw)
To: gcc-bugs
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (9 preceding siblings ...)
2005-12-19 18:29 ` mmitchel at gcc dot gnu dot org
@ 2005-12-19 18:29 ` mmitchel at gcc dot gnu dot org
2005-12-19 18:36 ` pinskia at gcc dot gnu dot org
` (17 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-12-19 18:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from mmitchel at gcc dot gnu dot org 2005-12-19 18:29 -------
(Why should we get 1? Upon entry to f, a will be 1, since 32769 will be
reduced modulo 2^16. Then, b will be 1 - 32768, or -32767. I don't see why
that should be converted to 1 -- but I certainly don't see why it should be
32768 either.)
In any case, wrong-code: P1.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (10 preceding siblings ...)
2005-12-19 18:29 ` mmitchel at gcc dot gnu dot org
@ 2005-12-19 18:36 ` pinskia at gcc dot gnu dot org
2005-12-19 18:38 ` kazu at codesourcery dot com
` (16 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-12-19 18:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pinskia at gcc dot gnu dot org 2005-12-19 18:36 -------
(In reply to comment #8)
> (Why should we get 1? Upon entry to f, a will be 1, since 32769 will be
> reduced modulo 2^16. Then, b will be 1 - 32768, or -32767. I don't see why
> that should be converted to 1 -- but I certainly don't see why it should be
> 32768 either.)
32769 == 0x8001 .
so a will not be 1. You are thinking it is reduced modulo 2^15.
so c will be negative as 0x8001 is negative so we don't take the branch.
and then we have 0x00008001 + -0x00008000 which is equal to 1.
Thanks,
Andrew Pinski
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (11 preceding siblings ...)
2005-12-19 18:36 ` pinskia at gcc dot gnu dot org
@ 2005-12-19 18:38 ` kazu at codesourcery dot com
2005-12-19 18:40 ` mark at codesourcery dot com
` (15 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: kazu at codesourcery dot com @ 2005-12-19 18:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from kazu at codesourcery dot com 2005-12-19 18:38 -------
Subject: Re: [4.1/4.2 Regression] (short) ((int)(unsigned
short) + (int)) is done in the wrong type
Hi Mark,
> (Why should we get 1? Upon entry to f, a will be 1, since 32769 will be
> reduced modulo 2^16. Then, b will be 1 - 32768, or -32767. I don't see why
> that should be converted to 1 -- but I certainly don't see why it should be
> 32768 either.)
>
> In any case, wrong-code: P1.
First, 32769 will be reduced to -32767.
(int) -32767 + -(int)32768 = -65535.
If we take the lowest 16 bits of -65535, we get 1, and that's what f should be
returning.
Kazu Hirata
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (12 preceding siblings ...)
2005-12-19 18:38 ` kazu at codesourcery dot com
@ 2005-12-19 18:40 ` mark at codesourcery dot com
2005-12-26 23:00 ` kazu at gcc dot gnu dot org
` (14 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: mark at codesourcery dot com @ 2005-12-19 18:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from mark at codesourcery dot com 2005-12-19 18:40 -------
Subject: Re: [4.1/4.2 Regression] (short) ((int)(unsigned
short) + (int)) is done in the wrong type
Kazu Hirata wrote:
> Hi Mark,
>
>> (Why should we get 1? Upon entry to f, a will be 1, since 32769 will be
>> reduced modulo 2^16. Then, b will be 1 - 32768, or -32767. I don't
>> see why
>> that should be converted to 1 -- but I certainly don't see why it
>> should be
>> 32768 either.)
>>
>> In any case, wrong-code: P1.
>
> First, 32769 will be reduced to -32767.
> (int) -32767 + -(int)32768 = -65535.
> If we take the lowest 16 bits of -65535, we get 1, and that's what f
> should be returning.
I believe you. :-)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (13 preceding siblings ...)
2005-12-19 18:40 ` mark at codesourcery dot com
@ 2005-12-26 23:00 ` kazu at gcc dot gnu dot org
2005-12-26 23:01 ` [Bug middle-end/25125] [4.1 " kazu at gcc dot gnu dot org
` (13 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: kazu at gcc dot gnu dot org @ 2005-12-26 23:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from kazu at gcc dot gnu dot org 2005-12-26 23:00 -------
Subject: Bug 25125
Author: kazu
Date: Mon Dec 26 23:00:18 2005
New Revision: 109065
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109065
Log:
gcc/
PR tree-optimization/25125
* convert.c (convert_to_integer): Don't narrow the type of a
PLUX_EXPR or MINUS_EXPR if !flag_wrapv and the unwidened type
is signed.
gcc/testsuite/
PR tree-optimization/25125
* gcc.dg/vect/vect-7.c, gcc.dg/vect/vect-reduc-2char.c,
gcc.dg/vect/vect-reduc-2short.c: XFAIL.
* gcc.c-torture/execute/pr25125.c: New.
Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr25125.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/convert.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/vect/vect-7.c
trunk/gcc/testsuite/gcc.dg/vect/vect-reduc-2char.c
trunk/gcc/testsuite/gcc.dg/vect/vect-reduc-2short.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (14 preceding siblings ...)
2005-12-26 23:00 ` kazu at gcc dot gnu dot org
@ 2005-12-26 23:01 ` kazu at gcc dot gnu dot org
2005-12-27 1:07 ` danglin at gcc dot gnu dot org
` (12 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: kazu at gcc dot gnu dot org @ 2005-12-26 23:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from kazu at gcc dot gnu dot org 2005-12-26 23:01 -------
Just checked in a patch for mainline (4.2.0).
--
kazu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|4.1.0 4.2.0 |4.1.0
Known to work|4.0.3 |4.0.3 4.2.0
Summary|[4.1/4.2 Regression] (short)|[4.1 Regression] (short)
|((int)(unsigned short) + |((int)(unsigned short) +
|(int)) is done in the wrong |(int)) is done in the wrong
|type |type
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (15 preceding siblings ...)
2005-12-26 23:01 ` [Bug middle-end/25125] [4.1 " kazu at gcc dot gnu dot org
@ 2005-12-27 1:07 ` danglin at gcc dot gnu dot org
2005-12-27 1:41 ` dave at hiauly1 dot hia dot nrc dot ca
` (11 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: danglin at gcc dot gnu dot org @ 2005-12-27 1:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from danglin at gcc dot gnu dot org 2005-12-27 01:07 -------
Running /mnt/gnu/gcc-3.3/gcc/gcc/testsuite/gcc.c-torture/execute/execute.exp
...
FAIL: gcc.c-torture/execute/pr25125.c execution, -O2
FAIL: gcc.c-torture/execute/pr25125.c execution, -O3 -fomit-frame-pointer
FAIL: gcc.c-torture/execute/pr25125.c execution, -O3 -g
FAIL: gcc.c-torture/execute/pr25125.c execution, -Os
--
danglin at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |danglin at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (16 preceding siblings ...)
2005-12-27 1:07 ` danglin at gcc dot gnu dot org
@ 2005-12-27 1:41 ` dave at hiauly1 dot hia dot nrc dot ca
2005-12-27 11:16 ` steven at gcc dot gnu dot org
` (10 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: dave at hiauly1 dot hia dot nrc dot ca @ 2005-12-27 1:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from dave at hiauly1 dot hia dot nrc dot ca 2005-12-27 01:41 -------
Subject: Re: [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done
in the wrong type
> ------- Comment #14 from danglin at gcc dot gnu dot org 2005-12-27 01:07 -------
> Running /mnt/gnu/gcc-3.3/gcc/gcc/testsuite/gcc.c-torture/execute/execute.exp
> ...
> FAIL: gcc.c-torture/execute/pr25125.c execution, -O2
> FAIL: gcc.c-torture/execute/pr25125.c execution, -O3 -fomit-frame-pointer
> FAIL: gcc.c-torture/execute/pr25125.c execution, -O3 -g
> FAIL: gcc.c-torture/execute/pr25125.c execution, -Os
Should have said this is on hppa2.0w-hp-hpux11.11. The initial rtl
for function f is wrong:
(jump_insn 14 13 15 3 (set (pc)
(if_then_else (gt (reg:SI 98)
(const_int 0 [0x0]))
(label_ref 20)
(pc))) -1 (nil)
(expr_list:REG_BR_PROB (const_int 1355 [0x54b])
(nil)))
;; End of basic block 3, registers live: (nil)
;; Start of basic block 4, registers live: (nil)
(code_label 15 14 16 4 3 "" [0 uses])
(note 16 15 17 4 [bb 4] NOTE_INSN_BASIC_BLOCK)
(insn 17 16 18 4 (set (reg:SI 94 [ D.1834 ])
(const_int 32768 [0x8000])) -1 (nil)
(nil))
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (17 preceding siblings ...)
2005-12-27 1:41 ` dave at hiauly1 dot hia dot nrc dot ca
@ 2005-12-27 11:16 ` steven at gcc dot gnu dot org
2005-12-27 15:00 ` dave at hiauly1 dot hia dot nrc dot ca
` (9 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-12-27 11:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #16 from steven at gcc dot gnu dot org 2005-12-27 11:16 -------
Re. comments #14 and #15 -- Dave you really should also say what compiler you
used, or people will just have to make a guess. They'd probably conclude you
are testing GCC 3.3 in this case ;-)
Anyway, if the initial RTL is wrong, we either feed wrong code to expand out of
the tree optimizers, or there is a bug in expand itself. Could you check
whether the .vars tree dump is still alright? You can generate it with
-fdump-tree-vars.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (18 preceding siblings ...)
2005-12-27 11:16 ` steven at gcc dot gnu dot org
@ 2005-12-27 15:00 ` dave at hiauly1 dot hia dot nrc dot ca
2005-12-27 16:59 ` kazu at gcc dot gnu dot org
` (8 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: dave at hiauly1 dot hia dot nrc dot ca @ 2005-12-27 15:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #17 from dave at hiauly1 dot hia dot nrc dot ca 2005-12-27 15:00 -------
Subject: Re: [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done
in the wrong type
> Re. comments #14 and #15 -- Dave you really should also say what compiler you
> used, or people will just have to make a guess. They'd probably conclude you
> are testing GCC 3.3 in this case ;-)
The test was only added to 4.2.0 (Kazu's previous comment), so I thought
the compiler under test would be obvious. Some day I'll have to update
the directory names. I just got used to typing "gcc-3.3" ;-)
> Anyway, if the initial RTL is wrong, we either feed wrong code to expand out of
> the tree optimizers, or there is a bug in expand itself. Could you check
> whether the .vars tree dump is still alright? You can generate it with
> -fdump-tree-vars.
Here is the .vars tree dump for function f:
;; Function f (f)
f (a)
{
int D.1496;
<bb 2>:
if (a > 0) goto <L3>; else goto <L4>;
<L4>:;
D.1496 = 32768;
goto <bb 4> (<L2>);
<L3>:;
D.1496 = 0;
<L2>:;
return D.1496;
}
Dave
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (19 preceding siblings ...)
2005-12-27 15:00 ` dave at hiauly1 dot hia dot nrc dot ca
@ 2005-12-27 16:59 ` kazu at gcc dot gnu dot org
2005-12-27 17:06 ` dave at hiauly1 dot hia dot nrc dot ca
` (7 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: kazu at gcc dot gnu dot org @ 2005-12-27 16:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #18 from kazu at gcc dot gnu dot org 2005-12-27 16:59 -------
Dave,
I am having tough time building the compiler for hppa2.0w-hp-hpux11.11.
These days gcc won't even allow you to build cc1 without an assembler and such.
How do you build your compiler? Using the native assembler?
By the way, could you tell me the sizes of short and int on
hppa2.0w-hp-hpux11.11?
Kazu Hirata
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (20 preceding siblings ...)
2005-12-27 16:59 ` kazu at gcc dot gnu dot org
@ 2005-12-27 17:06 ` dave at hiauly1 dot hia dot nrc dot ca
2005-12-27 19:27 ` dave at hiauly1 dot hia dot nrc dot ca
` (6 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: dave at hiauly1 dot hia dot nrc dot ca @ 2005-12-27 17:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #19 from dave at hiauly1 dot hia dot nrc dot ca 2005-12-27 17:06 -------
Subject: Re: [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done
in the wrong type
> I am having tough time building the compiler for hppa2.0w-hp-hpux11.11.
> These days gcc won't even allow you to build cc1 without an assembler and such.
That's a regression. It always used to be possible to build
cc1 on x86, etc. I'll take a look.
> How do you build your compiler? Using the native assembler?
I always use gas.
> By the way, could you tell me the sizes of short and int on
> hppa2.0w-hp-hpux11.11?
2 and 4 bytes, respectively.
Dave
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (21 preceding siblings ...)
2005-12-27 17:06 ` dave at hiauly1 dot hia dot nrc dot ca
@ 2005-12-27 19:27 ` dave at hiauly1 dot hia dot nrc dot ca
2005-12-27 22:35 ` dave at hiauly1 dot hia dot nrc dot ca
` (5 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: dave at hiauly1 dot hia dot nrc dot ca @ 2005-12-27 19:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #20 from dave at hiauly1 dot hia dot nrc dot ca 2005-12-27 19:27 -------
Subject: Re: [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done
in the wrong type
> > I am having tough time building the compiler for hppa2.0w-hp-hpux11.11.
> > These days gcc won't even allow you to build cc1 without an assembler and such.
>
> That's a regression. It always used to be possible to build
> cc1 on x86, etc. I'll take a look.
This seems to work for me on x86 linux:
../gcc/configure --with-gnu-as --disable-shared --disable-nls
--prefix=/home/dave/opt/gnu --target=hppa2.0w-hp-hpux11.11 &&
make &&
However, I'm getting different tree code with the x86 cross.
;; Function f (f)
f (a)
{
int D.1491;
<bb 2>:
if ((short int) a > 0) goto <L4>; else goto <L1>;
<L4>:;
D.1491 = 0;
goto <bb 4> (<L2>);
<L1>:;
D.1491 = (int) (short unsigned int) (short int) (a + 32768);
<L2>:;
return D.1491;
}
Not sure why? The native hppa build generates the same code using
the stage1 compiler. I have a few patches in my tree. The only one
that might be relevant is the fix for PR 25394.
Dave
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (22 preceding siblings ...)
2005-12-27 19:27 ` dave at hiauly1 dot hia dot nrc dot ca
@ 2005-12-27 22:35 ` dave at hiauly1 dot hia dot nrc dot ca
2006-01-09 4:37 ` kazu at gcc dot gnu dot org
` (4 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: dave at hiauly1 dot hia dot nrc dot ca @ 2005-12-27 22:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #21 from dave at hiauly1 dot hia dot nrc dot ca 2005-12-27 22:35 -------
Subject: Re: [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done
in the wrong type
> However, I'm getting different tree code with the x86 cross.
I can't reproduce this problem. Maybe I forgot to remove the last
build after updating and cc1 didn't get rebuilt, or somehow svn messed
up and I didn't get the change to convert.c.
Dave
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (23 preceding siblings ...)
2005-12-27 22:35 ` dave at hiauly1 dot hia dot nrc dot ca
@ 2006-01-09 4:37 ` kazu at gcc dot gnu dot org
2006-01-09 4:40 ` kazu at gcc dot gnu dot org
` (3 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: kazu at gcc dot gnu dot org @ 2006-01-09 4:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #22 from kazu at gcc dot gnu dot org 2006-01-09 04:37 -------
Subject: Bug 25125
Author: kazu
Date: Mon Jan 9 04:37:09 2006
New Revision: 109495
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109495
Log:
gcc/
PR tree-optimization/25125
* convert.c (convert_to_integer): Don't narrow the type of a
PLUX_EXPR or MINUS_EXPR if !flag_wrapv and the unwidened type
is signed.
gcc/testsuite/
PR tree-optimization/25125
* gcc.dg/vect/vect-7.c, gcc.dg/vect/vect-reduc-2char.c,
gcc.dg/vect/vect-reduc-2short.c: XFAIL.
* gcc.c-torture/execute/pr25125.c: New.
Added:
branches/gcc-4_1-branch/gcc/testsuite/gcc.c-torture/execute/pr25125.c
Modified:
branches/gcc-4_1-branch/gcc/ChangeLog
branches/gcc-4_1-branch/gcc/convert.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/vect/vect-7.c
branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/vect/vect-reduc-2char.c
branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/vect/vect-reduc-2short.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (24 preceding siblings ...)
2006-01-09 4:37 ` kazu at gcc dot gnu dot org
@ 2006-01-09 4:40 ` kazu at gcc dot gnu dot org
2006-01-09 4:42 ` kazu at gcc dot gnu dot org
` (2 subsequent siblings)
28 siblings, 0 replies; 30+ messages in thread
From: kazu at gcc dot gnu dot org @ 2006-01-09 4:40 UTC (permalink / raw)
To: gcc-bugs
--
kazu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|4.1.0 |
Known to work|4.0.3 4.2.0 |4.0.3 4.1.0 4.2.0
Target Milestone|4.1.0 |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (25 preceding siblings ...)
2006-01-09 4:40 ` kazu at gcc dot gnu dot org
@ 2006-01-09 4:42 ` kazu at gcc dot gnu dot org
2006-01-09 4:43 ` kazu at gcc dot gnu dot org
2006-02-26 14:44 ` dorit at gcc dot gnu dot org
28 siblings, 0 replies; 30+ messages in thread
From: kazu at gcc dot gnu dot org @ 2006-01-09 4:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #23 from kazu at gcc dot gnu dot org 2006-01-09 04:42 -------
Checked in a patch to both 4.1 and 4.2.
--
kazu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (26 preceding siblings ...)
2006-01-09 4:42 ` kazu at gcc dot gnu dot org
@ 2006-01-09 4:43 ` kazu at gcc dot gnu dot org
2006-02-26 14:44 ` dorit at gcc dot gnu dot org
28 siblings, 0 replies; 30+ messages in thread
From: kazu at gcc dot gnu dot org @ 2006-01-09 4:43 UTC (permalink / raw)
To: gcc-bugs
--
kazu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.3 |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
* [Bug middle-end/25125] [4.1 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
` (27 preceding siblings ...)
2006-01-09 4:43 ` kazu at gcc dot gnu dot org
@ 2006-02-26 14:44 ` dorit at gcc dot gnu dot org
28 siblings, 0 replies; 30+ messages in thread
From: dorit at gcc dot gnu dot org @ 2006-02-26 14:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #24 from dorit at gcc dot gnu dot org 2006-02-26 12:55 -------
Subject: Bug 25125
Author: dorit
Date: Sun Feb 26 12:55:43 2006
New Revision: 111452
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111452
Log:
PR tree-optimization/25125
* gcc.dg/vect/wrapv-vect-7.c, gcc.dg/vect/wrapv-vect-reduc-2char.c,
gcc.dg/vect/wrapv-vect-reduc-2short.c: New tests.
Added:
trunk/gcc/testsuite/gcc.dg/vect/wrapv-vect-7.c
trunk/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c
trunk/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c
Modified:
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2006-02-26 12:55 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-27 17:39 [Bug c/25125] New: [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type pinskia at gcc dot gnu dot org
2005-11-27 17:40 ` [Bug c/25125] " pinskia at gcc dot gnu dot org
2005-11-27 17:42 ` pinskia at gcc dot gnu dot org
2005-11-27 17:45 ` rguenth at gcc dot gnu dot org
2005-11-27 17:47 ` rguenth at gcc dot gnu dot org
2005-11-27 18:03 ` [Bug middle-end/25125] " pinskia at gcc dot gnu dot org
2005-11-28 21:48 ` janis at gcc dot gnu dot org
2005-12-04 4:21 ` pinskia at gcc dot gnu dot org
2005-12-17 17:26 ` kazu at gcc dot gnu dot org
2005-12-18 15:51 ` steven at gcc dot gnu dot org
2005-12-19 18:29 ` mmitchel at gcc dot gnu dot org
2005-12-19 18:29 ` mmitchel at gcc dot gnu dot org
2005-12-19 18:36 ` pinskia at gcc dot gnu dot org
2005-12-19 18:38 ` kazu at codesourcery dot com
2005-12-19 18:40 ` mark at codesourcery dot com
2005-12-26 23:00 ` kazu at gcc dot gnu dot org
2005-12-26 23:01 ` [Bug middle-end/25125] [4.1 " kazu at gcc dot gnu dot org
2005-12-27 1:07 ` danglin at gcc dot gnu dot org
2005-12-27 1:41 ` dave at hiauly1 dot hia dot nrc dot ca
2005-12-27 11:16 ` steven at gcc dot gnu dot org
2005-12-27 15:00 ` dave at hiauly1 dot hia dot nrc dot ca
2005-12-27 16:59 ` kazu at gcc dot gnu dot org
2005-12-27 17:06 ` dave at hiauly1 dot hia dot nrc dot ca
2005-12-27 19:27 ` dave at hiauly1 dot hia dot nrc dot ca
2005-12-27 22:35 ` dave at hiauly1 dot hia dot nrc dot ca
2006-01-09 4:37 ` kazu at gcc dot gnu dot org
2006-01-09 4:40 ` kazu at gcc dot gnu dot org
2006-01-09 4:42 ` kazu at gcc dot gnu dot org
2006-01-09 4:43 ` kazu at gcc dot gnu dot org
2006-02-26 14:44 ` dorit at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).