[Bug middle-end/66630] Missing ubsan/ftrapv error

2024-04-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66630

--- Comment #5 from Andrew Pinski  ---
(In reply to Marek Polacek from comment #2)
> That's one thing.  But there also something else going on.  I hope it's just
> missing TYPE_OVERFLOW_SANITIZED in some match.pd patterns.

```
  /* ~A + A -> -1 */
  (simplify
   (plus:c (convert? (bit_not @0)) (convert? @0))
   (if (!TYPE_OVERFLOW_TRAPS (type))
(convert { build_all_ones_cst (TREE_TYPE (@0)); })))

  /* ~A + 1 -> -A */
  (simplify
   (plus (convert? (bit_not @0)) integer_each_onep)
   (if (tree_nop_conversion_p (type, TREE_TYPE (@0)))
(negate (convert @0

  /* -A - 1 -> ~A */
  (simplify
   (minus (convert? (negate @0)) integer_each_onep)
   (if (!TYPE_OVERFLOW_TRAPS (type)
&& TREE_CODE (type) != COMPLEX_TYPE
&& tree_nop_conversion_p (type, TREE_TYPE (@0)))
(bit_not (convert @0

  /* -1 - A -> ~A */
  (simplify
   (minus integer_all_onesp @0)
   (if (TREE_CODE (type) != COMPLEX_TYPE)
(bit_not @0)))

```

I am not sure which one of these patterns need the check for
TYPE_OVERFLOW_SANITIZED though.

[Bug middle-end/66630] Missing ubsan/ftrapv error

2021-07-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66630

Andrew Pinski  changed:

   What|Removed |Added

 CC||vincent-gcc at vinc17 dot net

--- Comment #4 from Andrew Pinski  ---
*** Bug 87311 has been marked as a duplicate of this bug. ***

[Bug middle-end/66630] Missing ubsan/ftrapv error

2016-01-26 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66630

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-01-26
 Ever confirmed|0   |1

[Bug middle-end/66630] Missing ubsan/ftrapv error

2015-06-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66630

--- Comment #3 from Richard Biener rguenth at gcc dot gnu.org ---
For -ftrapv I never got around to commit some of the fixes I posted last
year...
(guard CCP properly for example).  Eventually at least CCP should be more
aggressive and simplify trapping stuff to __builtin_trap () (but the optab
implementations in libgcc use abort ()).


[Bug middle-end/66630] Missing ubsan/ftrapv error

2015-06-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66630

--- Comment #2 from Marek Polacek mpolacek at gcc dot gnu.org ---
That's one thing.  But there also something else going on.  I hope it's just
missing TYPE_OVERFLOW_SANITIZED in some match.pd patterns.


[Bug middle-end/66630] Missing ubsan/ftrapv error

2015-06-22 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66630

--- Comment #1 from Andrew Pinski pinskia at gcc dot gnu.org ---
This might be because we convert -i - 1 to be ~i.