public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/40987] Wrong optimization with if-conversion
       [not found] <bug-40987-4@http.gcc.gnu.org/bugzilla/>
@ 2012-01-21 21:33 ` pinskia at gcc dot gnu.org
  2021-07-19 23:50 ` [Bug rtl-optimization/40987] ifcvt sometimes goes wrong for integer modes > 64bit pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-21 21:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40987

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|i686                        |
               Host|i686                        |HWI == 32
              Build|i686                        |

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-21 21:27:18 UTC ---
This bug is now hard to hit on the trunk as i?86 requires host wide word as
64bit.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug rtl-optimization/40987] ifcvt sometimes goes wrong for integer modes > 64bit
       [not found] <bug-40987-4@http.gcc.gnu.org/bugzilla/>
  2012-01-21 21:33 ` [Bug rtl-optimization/40987] Wrong optimization with if-conversion pinskia at gcc dot gnu.org
@ 2021-07-19 23:50 ` pinskia at gcc dot gnu.org
  2023-06-02  0:56 ` pinskia at gcc dot gnu.org
  2023-06-02  1:02 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-19 23:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40987

--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #11)
> This bug is now hard to hit on the trunk as i?86 requires host wide word as
> 64bit.

HWINT is now required to be 64bit for all targets even.
So this might happen if there is some TImode but then the patch might be best
thing really.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug rtl-optimization/40987] ifcvt sometimes goes wrong for integer modes > 64bit
       [not found] <bug-40987-4@http.gcc.gnu.org/bugzilla/>
  2012-01-21 21:33 ` [Bug rtl-optimization/40987] Wrong optimization with if-conversion pinskia at gcc dot gnu.org
  2021-07-19 23:50 ` [Bug rtl-optimization/40987] ifcvt sometimes goes wrong for integer modes > 64bit pinskia at gcc dot gnu.org
@ 2023-06-02  0:56 ` pinskia at gcc dot gnu.org
  2023-06-02  1:02 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-02  0:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40987

--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Here is a x86_64-linux-gnu testcase:
```
#include <stdio.h>

typedef __int128_t mytype;
#define value (((__int128_t)(((unsigned long long)__LONG_LONG_MAX__)+1)) |
(((__int128_t)0xffffffffffffffffull)<<64))

mytype func(long arg) __attribute__((noinline,noclone));
mytype func(long arg) {
   mytype val = 0;
   if (arg < 0) {
    // __int128_t t = 0x8000000000000000ull |
(((__int128_t)0xffffffffffffffff)<<64);
      val = value;
   }
   return val;
}

int main() {
   mytype result = func(-1);
   if (result != value) {
      printf("failed.\n");
      return 1;
   } 
   printf("passed.\n");
   return 0;
}
```

It failed until GCC 4.9.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug rtl-optimization/40987] ifcvt sometimes goes wrong for integer modes > 64bit
       [not found] <bug-40987-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2023-06-02  0:56 ` pinskia at gcc dot gnu.org
@ 2023-06-02  1:02 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-02  1:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40987

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |4.9.0

--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Looks like this was fixed with r0-127324-ge15eb172b0dd (aka PR 59545).
Basically a signed integer overflow inside the compiler was causing the wrong
code happening.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-02  1:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-40987-4@http.gcc.gnu.org/bugzilla/>
2012-01-21 21:33 ` [Bug rtl-optimization/40987] Wrong optimization with if-conversion pinskia at gcc dot gnu.org
2021-07-19 23:50 ` [Bug rtl-optimization/40987] ifcvt sometimes goes wrong for integer modes > 64bit pinskia at gcc dot gnu.org
2023-06-02  0:56 ` pinskia at gcc dot gnu.org
2023-06-02  1:02 ` pinskia at gcc dot gnu.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).