[Bug analyzer/113983] [14 Regression] ICE: tree check: expected integer_cst, have vector_cst in maybe_undo_optimize_bit_field_compare, at analyzer/region-model-manager.cc:606 with -fanalyzer

2024-02-20 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113983

--- Comment #6 from GCC Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:ecfcc362b7f3f796c72f3525c4e3a6dd8ab3beac

commit r14-9079-gecfcc362b7f3f796c72f3525c4e3a6dd8ab3beac
Author: Jakub Jelinek 
Date:   Tue Feb 20 10:31:46 2024 +0100

testsuite: Fix up analyzer/torture/vector-extract-1.c test for i686
[PR113983]

The testcase fails on i686-linux with
.../gcc/testsuite/gcc.dg/analyzer/torture/vector-extract-1.c:11:1: warning:
MMX vector return without MMX enabled changes the ABI [-Wpsabi]
Added -Wno-psabi to silence the warning.

2024-02-20  Jakub Jelinek  

PR analyzer/113983
* gcc.dg/analyzer/torture/vector-extract-1.c: Add -Wno-psabi as
dg-additional-options.

[Bug analyzer/113983] [14 Regression] ICE: tree check: expected integer_cst, have vector_cst in maybe_undo_optimize_bit_field_compare, at analyzer/region-model-manager.cc:606 with -fanalyzer

2024-02-19 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113983

--- Comment #5 from David Malcolm  ---
(In reply to Andrew Pinski from comment #4)
> Fixed.

Thanks!

[Bug analyzer/113983] [14 Regression] ICE: tree check: expected integer_cst, have vector_cst in maybe_undo_optimize_bit_field_compare, at analyzer/region-model-manager.cc:606 with -fanalyzer

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

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #4 from Andrew Pinski  ---
Fixed.

[Bug analyzer/113983] [14 Regression] ICE: tree check: expected integer_cst, have vector_cst in maybe_undo_optimize_bit_field_compare, at analyzer/region-model-manager.cc:606 with -fanalyzer

2024-02-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113983

--- Comment #3 from GCC Commits  ---
The trunk branch has been updated by Andrew Pinski :

https://gcc.gnu.org/g:d70facd54a576faca1bfba96e92e1475e0da22a3

commit r14-9074-gd70facd54a576faca1bfba96e92e1475e0da22a3
Author: Andrew Pinski 
Date:   Sun Feb 18 14:14:23 2024 -0800

analyzer: Fix maybe_undo_optimize_bit_field_compare vs non-scalar types
[PR113983]

After r14-6419-g4eaaf7f5a378e8, maybe_undo_optimize_bit_field_compare would
ICE on
vector CST but this function really should be checking if we had integer
types so
reject non-integral types early on (like it was doing for non-char type
before r14-6419-g4eaaf7f5a378e8).

Committed as obvious after build and tested for aarch64-linux-gnu with no
regressions.

PR analyzer/113983

gcc/analyzer/ChangeLog:

* region-model-manager.cc (maybe_undo_optimize_bit_field_compare):
Reject
non integral types.

gcc/testsuite/ChangeLog:

* gcc.dg/analyzer/torture/vector-extract-1.c: New test.

Signed-off-by: Andrew Pinski 

[Bug analyzer/113983] [14 Regression] ICE: tree check: expected integer_cst, have vector_cst in maybe_undo_optimize_bit_field_compare, at analyzer/region-model-manager.cc:606 with -fanalyzer

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-02-18
 CC||dmalcolm at gcc dot gnu.org
   Assignee|dmalcolm at gcc dot gnu.org|pinskia at gcc dot 
gnu.org
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1

--- Comment #2 from Andrew Pinski  ---
Almost definitely introduced by r14-6419-g4eaaf7f5a378e8.

Fix:
[apinski@xeond2 gcc]$ git diff
diff --git a/gcc/analyzer/region-model-manager.cc
b/gcc/analyzer/region-model-manager.cc
index 62f808a81c2..21e13b48025 100644
--- a/gcc/analyzer/region-model-manager.cc
+++ b/gcc/analyzer/region-model-manager.cc
@@ -602,6 +602,9 @@ maybe_undo_optimize_bit_field_compare (tree type,
   tree cst,
   const svalue *arg1)
 {
+  if (!INTEGRAL_TYPE_P (type))
+return NULL;
+
   const binding_map  = compound_sval->get_map ();
   unsigned HOST_WIDE_INT mask = TREE_INT_CST_LOW (cst);
   /* If "mask" is a contiguous range of set bits, see if the

[Bug analyzer/113983] [14 Regression] ICE: tree check: expected integer_cst, have vector_cst in maybe_undo_optimize_bit_field_compare, at analyzer/region-model-manager.cc:606 with -fanalyzer

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |14.0
 CC||pinskia at gcc dot gnu.org

--- Comment #1 from Andrew Pinski  ---
Let me look since I touched maybe_undo_optimize_bit_field_compare last.