https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25186
Roger Sayle changed:
What|Removed |Added
Target Milestone|--- |13.0
Status|NEW
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25186
Richard Biener changed:
What|Removed |Added
Keywords||easyhack
Last reconfirmed|2021-08-21
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25186
Gabriel Ravier changed:
What|Removed |Added
CC||gabravier at gmail dot com
--- Comment
--- Comment #7 from rguenth at gcc dot gnu dot org 2006-04-05 13:49 ---
I'm no longer working on this.
--
rguenth at gcc dot gnu dot org changed:
What|Removed |Added
--- Comment #2 from rguenth at gcc dot gnu dot org 2005-12-01 10:53 ---
Confirmed. The first testcase is really just
short *a;
void f(void)
{
*a = *a 1;
}
interestingly, the C frontend does not do integer promotion of
unsigned short *a;
void f(voif)
{
*a = *a 1;
}
where *a
--- Comment #3 from rguenth at gcc dot gnu dot org 2005-12-01 11:01 ---
Doh. The C frontend _does_ the promotion (in the unsigned case):
(intD.0) *aD.1296 1
just convert.c:convert_to_integer folds it to a shift on unsigned short
again.
This transformation should be moved to fold
--- Comment #4 from rguenth at gcc dot gnu dot org 2005-12-01 12:28 ---
convert_to_integer contains
case LSHIFT_EXPR:
/* We can pass truncation down through left shifting
when the shift count is a nonnegative constant and
the target type is
--- Comment #5 from rguenth at gcc dot gnu dot org 2005-12-01 12:46 ---
I.e. 6.3.1.3/3 says that conversion from type T to signed type is
implementation defined if the value doesn't fit. And we define it to reducing
it modulo 2^N.
So, for !flag_wrapv
(short)((int)0x8000 1) == 0
--- Comment #6 from rguenth at gcc dot gnu dot org 2005-12-01 14:17 ---
I have two fixes. One really safe and one ok via IRC communication.
--
rguenth at gcc dot gnu dot org changed:
What|Removed |Added