* [Bug c++/98556] [11 Regression] ICE: 'verify_gimple' failed on arm-linux-gnueabihf
2021-01-06 9:09 [Bug c++/98556] New: [11 Regression] ICE doko at debian dot org
@ 2021-01-06 9:13 ` doko at debian dot org
2021-01-06 9:13 ` doko at debian dot org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: doko at debian dot org @ 2021-01-06 9:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98556
Matthias Klose <doko at debian dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[11 Regression] ICE |[11 Regression] ICE:
| |'verify_gimple' failed on
| |arm-linux-gnueabihf
Known to fail| |11.0
Keywords| |ice-on-valid-code
Target| |arm-linux-gnueabihf
Known to work| |10.2.1
--- Comment #1 from Matthias Klose <doko at debian dot org> ---
seen with trunk 20210102 on arm-linux-gnueabihf
g++ -c -O0 var.i
/ var.c: In function 'var_rc_t parse_input(var_t*, var_parse_t*, const char*,
const char*, tokenbuf
_t*, int)':
// var.c:2233:1: error: type mismatch in 'pointer_diff_expr'
// 2233 | parse_input(
// | ^~~~~~~~~~~
// var_rc_t
//
// const char *
//
// const char *
//
// D.37449 = p - begin;
// var.c:2233:1: internal compiler error: 'verify_gimple' failed
// 0xa97ce9 verify_gimple_in_seq(gimple*)
// ../../src/gcc/tree-cfg.c:5119
// 0x9a4a8b gimplify_body(tree_node*, bool)
// ../../src/gcc/gimplify.c:15362
// 0x9a44b5 gimplify_function_tree(tree_node*)
// ../../src/gcc/gimplify.c:15433
// 0x8d86bd cgraph_node::analyze()
// ../../src/gcc/cgraphunit.c:670
// 0x8d5d3f analyze_functions
// ../../src/gcc/cgraphunit.c:1235
// 0xeeb183 symbol_table::finalize_compilation_unit()
// ../../src/gcc/cgraphunit.c:2513
// Please submit a full bug report,
// with preprocessed source if appropriate.
gcc configured with
// Configured with: ../src/configure -v --with-pkgversion='Ubuntu
11-20210102-1ubuntu1' --with-bugur
l=file:///usr/share/doc/gcc-11/README.Bugs
--enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2
--prefix=/usr --with-gcc-major-version-only --program-suffix=-11
--program-prefix=arm-linux-gnueabi
hf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib
--without-included-gettext --enab
le-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap
--enable-clocale=gnu --enable-lib
stdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new
--enable-gnu-unique-object
--disable-libitm --disable-libquadmath --disable-libquadmath-support
--enable-plugin --enable-defau
lt-pie --with-system-zlib --enable-libphobos-checking=release
--with-target-system-zlib=auto --enabl
e-objc-gc=auto --enable-multiarch --enable-multilib --disable-sjlj-exceptions
--with-arch=armv7-a --
with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror
--enable-multilib --enable-c
hecking=yes --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf
--target=arm-linux-gnueabihf
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/98556] [11 Regression] ICE: 'verify_gimple' failed on arm-linux-gnueabihf
2021-01-06 9:09 [Bug c++/98556] New: [11 Regression] ICE doko at debian dot org
2021-01-06 9:13 ` [Bug c++/98556] [11 Regression] ICE: 'verify_gimple' failed on arm-linux-gnueabihf doko at debian dot org
@ 2021-01-06 9:13 ` doko at debian dot org
2021-01-06 9:19 ` [Bug c++/98556] [11 Regression] ICE: 'verify_gimple' failed on arm-linux-gnueabihf since r8-4821-g1af4ebf5985ef2aa marxin at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: doko at debian dot org @ 2021-01-06 9:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98556
--- Comment #2 from Matthias Klose <doko at debian dot org> ---
Created attachment 49895
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49895&action=edit
preprocessed source
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/98556] [11 Regression] ICE: 'verify_gimple' failed on arm-linux-gnueabihf since r8-4821-g1af4ebf5985ef2aa
2021-01-06 9:09 [Bug c++/98556] New: [11 Regression] ICE doko at debian dot org
2021-01-06 9:13 ` [Bug c++/98556] [11 Regression] ICE: 'verify_gimple' failed on arm-linux-gnueabihf doko at debian dot org
2021-01-06 9:13 ` doko at debian dot org
@ 2021-01-06 9:19 ` marxin at gcc dot gnu.org
2021-01-06 9:32 ` [Bug c++/98556] [8/9/10/11 Regression] ICE: 'verify_gimple' failed " glisse at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-01-06 9:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98556
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |glisse at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
Ever confirmed|0 |1
Known to work|10.2.1 |
Status|UNCONFIRMED |NEW
Summary|[11 Regression] ICE: |[11 Regression] ICE:
|'verify_gimple' failed on |'verify_gimple' failed on
|arm-linux-gnueabihf |arm-linux-gnueabihf since
| |r8-4821-g1af4ebf5985ef2aa
Target|arm-linux-gnueabihf |arm-linux-gnueabihf,
| |x86_64-linux-gnu
Last reconfirmed| |2021-01-06
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed on x86_64 as well:
$ cat pr98556.ii
typedef enum { VAR_ERR_INCOMPLETE_NAMED_CHARACTER = -1 } var_rc_t;
char parse_input_begin, parse_input_p;
var_rc_t parse_input() { return var_rc_t(&parse_input_p - &parse_input_begin);
}
$ g++-10 pr98556.ii -c -m32 -fchecking
pr98556.ii: In function ‘var_rc_t parse_input()’:
pr98556.ii:3:10: error: type mismatch in ‘pointer_diff_expr’
3 | var_rc_t parse_input() { return var_rc_t(&parse_input_p -
&parse_input_begin); }
| ^~~~~~~~~~~
var_rc_t
char *
char *
D.2274 = &parse_input_p - &parse_input_begin;
pr98556.ii:3: confused by earlier errors, bailing out
Started with r8-4821-g1af4ebf5985ef2aa.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/98556] [8/9/10/11 Regression] ICE: 'verify_gimple' failed since r8-4821-g1af4ebf5985ef2aa
2021-01-06 9:09 [Bug c++/98556] New: [11 Regression] ICE doko at debian dot org
` (2 preceding siblings ...)
2021-01-06 9:19 ` [Bug c++/98556] [11 Regression] ICE: 'verify_gimple' failed on arm-linux-gnueabihf since r8-4821-g1af4ebf5985ef2aa marxin at gcc dot gnu.org
@ 2021-01-06 9:32 ` glisse at gcc dot gnu.org
2021-01-08 15:06 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: glisse at gcc dot gnu.org @ 2021-01-06 9:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98556
--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> ---
The result of the subtraction is supposed to be an integer type, and is instead
an enum based on that underlying type? Maybe the verification code needs
tweaking to allow that.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/98556] [8/9/10/11 Regression] ICE: 'verify_gimple' failed since r8-4821-g1af4ebf5985ef2aa
2021-01-06 9:09 [Bug c++/98556] New: [11 Regression] ICE doko at debian dot org
` (3 preceding siblings ...)
2021-01-06 9:32 ` [Bug c++/98556] [8/9/10/11 Regression] ICE: 'verify_gimple' failed " glisse at gcc dot gnu.org
@ 2021-01-08 15:06 ` jakub at gcc dot gnu.org
2021-01-09 9:50 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-08 15:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98556
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 49921
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49921&action=edit
gcc11-pr98556.patch
Untested fix.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/98556] [8/9/10/11 Regression] ICE: 'verify_gimple' failed since r8-4821-g1af4ebf5985ef2aa
2021-01-06 9:09 [Bug c++/98556] New: [11 Regression] ICE doko at debian dot org
` (4 preceding siblings ...)
2021-01-08 15:06 ` jakub at gcc dot gnu.org
@ 2021-01-09 9:50 ` cvs-commit at gcc dot gnu.org
2021-01-09 9:53 ` [Bug c++/98556] [8/9/10 " jakub at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-09 9:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98556
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:991656092f78eeab2a48fdbacf4e1f08567badaf
commit r11-6563-g991656092f78eeab2a48fdbacf4e1f08567badaf
Author: Jakub Jelinek <jakub@redhat.com>
Date: Sat Jan 9 10:49:38 2021 +0100
tree-cfg: Allow enum types as result of POINTER_DIFF_EXPR [PR98556]
As conversions between signed integers and signed enums with the same
precision are useless in GIMPLE, it seems strange that we require that
POINTER_DIFF_EXPR result must be INTEGER_TYPE.
If we really wanted to require that, we'd need to change the gimplifier
to ensure that, which it isn't the case on the following testcase.
What is going on during the gimplification is that when we have the
(enum T) (p - q) cast, it is stripped through
/* Strip away as many useless type conversions as possible
at the toplevel. */
STRIP_USELESS_TYPE_CONVERSION (*expr_p);
and when the MODIFY_EXPR is gimplified, the *to_p has enum T type,
while *from_p has intptr_t type and as there is no conversion in between,
we just create GIMPLE_ASSIGN from that.
2021-01-09 Jakub Jelinek <jakub@redhat.com>
PR c++/98556
* tree-cfg.c (verify_gimple_assign_binary): Allow lhs of
POINTER_DIFF_EXPR to be any integral type.
* c-c++-common/pr98556.c: New test.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/98556] [8/9/10 Regression] ICE: 'verify_gimple' failed since r8-4821-g1af4ebf5985ef2aa
2021-01-06 9:09 [Bug c++/98556] New: [11 Regression] ICE doko at debian dot org
` (5 preceding siblings ...)
2021-01-09 9:50 ` cvs-commit at gcc dot gnu.org
@ 2021-01-09 9:53 ` jakub at gcc dot gnu.org
2021-01-09 10:52 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-09 9:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98556
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[8/9/10/11 Regression] ICE: |[8/9/10 Regression] ICE:
|'verify_gimple' failed |'verify_gimple' failed
|since |since
|r8-4821-g1af4ebf5985ef2aa |r8-4821-g1af4ebf5985ef2aa
Target Milestone|--- |8.5
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/98556] [8/9/10 Regression] ICE: 'verify_gimple' failed since r8-4821-g1af4ebf5985ef2aa
2021-01-06 9:09 [Bug c++/98556] New: [11 Regression] ICE doko at debian dot org
` (6 preceding siblings ...)
2021-01-09 9:53 ` [Bug c++/98556] [8/9/10 " jakub at gcc dot gnu.org
@ 2021-01-09 10:52 ` cvs-commit at gcc dot gnu.org
2021-01-09 10:52 ` [Bug c++/98556] [8/9 " jakub at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-09 10:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98556
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:0188eab844eacda5edc6257771edb771844ae069
commit r10-9242-g0188eab844eacda5edc6257771edb771844ae069
Author: Jakub Jelinek <jakub@redhat.com>
Date: Sat Jan 9 10:49:38 2021 +0100
tree-cfg: Allow enum types as result of POINTER_DIFF_EXPR [PR98556]
As conversions between signed integers and signed enums with the same
precision are useless in GIMPLE, it seems strange that we require that
POINTER_DIFF_EXPR result must be INTEGER_TYPE.
If we really wanted to require that, we'd need to change the gimplifier
to ensure that, which it isn't the case on the following testcase.
What is going on during the gimplification is that when we have the
(enum T) (p - q) cast, it is stripped through
/* Strip away as many useless type conversions as possible
at the toplevel. */
STRIP_USELESS_TYPE_CONVERSION (*expr_p);
and when the MODIFY_EXPR is gimplified, the *to_p has enum T type,
while *from_p has intptr_t type and as there is no conversion in between,
we just create GIMPLE_ASSIGN from that.
2021-01-09 Jakub Jelinek <jakub@redhat.com>
PR c++/98556
* tree-cfg.c (verify_gimple_assign_binary): Allow lhs of
POINTER_DIFF_EXPR to be any integral type.
* c-c++-common/pr98556.c: New test.
(cherry picked from commit 991656092f78eeab2a48fdbacf4e1f08567badaf)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/98556] [8/9 Regression] ICE: 'verify_gimple' failed since r8-4821-g1af4ebf5985ef2aa
2021-01-06 9:09 [Bug c++/98556] New: [11 Regression] ICE doko at debian dot org
` (7 preceding siblings ...)
2021-01-09 10:52 ` cvs-commit at gcc dot gnu.org
@ 2021-01-09 10:52 ` jakub at gcc dot gnu.org
2021-04-20 23:31 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-09 10:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98556
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[8/9/10 Regression] ICE: |[8/9 Regression] ICE:
|'verify_gimple' failed |'verify_gimple' failed
|since |since
|r8-4821-g1af4ebf5985ef2aa |r8-4821-g1af4ebf5985ef2aa
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed also for 10.3+.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/98556] [8/9 Regression] ICE: 'verify_gimple' failed since r8-4821-g1af4ebf5985ef2aa
2021-01-06 9:09 [Bug c++/98556] New: [11 Regression] ICE doko at debian dot org
` (8 preceding siblings ...)
2021-01-09 10:52 ` [Bug c++/98556] [8/9 " jakub at gcc dot gnu.org
@ 2021-04-20 23:31 ` cvs-commit at gcc dot gnu.org
2021-04-22 16:49 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:11 ` jakub at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-20 23:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98556
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:ab4f73ae118a57bc50d72c727609d11540447d28
commit r9-9405-gab4f73ae118a57bc50d72c727609d11540447d28
Author: Jakub Jelinek <jakub@redhat.com>
Date: Sat Jan 9 10:49:38 2021 +0100
tree-cfg: Allow enum types as result of POINTER_DIFF_EXPR [PR98556]
As conversions between signed integers and signed enums with the same
precision are useless in GIMPLE, it seems strange that we require that
POINTER_DIFF_EXPR result must be INTEGER_TYPE.
If we really wanted to require that, we'd need to change the gimplifier
to ensure that, which it isn't the case on the following testcase.
What is going on during the gimplification is that when we have the
(enum T) (p - q) cast, it is stripped through
/* Strip away as many useless type conversions as possible
at the toplevel. */
STRIP_USELESS_TYPE_CONVERSION (*expr_p);
and when the MODIFY_EXPR is gimplified, the *to_p has enum T type,
while *from_p has intptr_t type and as there is no conversion in between,
we just create GIMPLE_ASSIGN from that.
2021-01-09 Jakub Jelinek <jakub@redhat.com>
PR c++/98556
* tree-cfg.c (verify_gimple_assign_binary): Allow lhs of
POINTER_DIFF_EXPR to be any integral type.
* c-c++-common/pr98556.c: New test.
(cherry picked from commit 0188eab844eacda5edc6257771edb771844ae069)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/98556] [8/9 Regression] ICE: 'verify_gimple' failed since r8-4821-g1af4ebf5985ef2aa
2021-01-06 9:09 [Bug c++/98556] New: [11 Regression] ICE doko at debian dot org
` (9 preceding siblings ...)
2021-04-20 23:31 ` cvs-commit at gcc dot gnu.org
@ 2021-04-22 16:49 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:11 ` jakub at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-22 16:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98556
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-8 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:34274b6f705df96c214455c9a3831842945a43a0
commit r8-10873-g34274b6f705df96c214455c9a3831842945a43a0
Author: Jakub Jelinek <jakub@redhat.com>
Date: Sat Jan 9 10:49:38 2021 +0100
tree-cfg: Allow enum types as result of POINTER_DIFF_EXPR [PR98556]
As conversions between signed integers and signed enums with the same
precision are useless in GIMPLE, it seems strange that we require that
POINTER_DIFF_EXPR result must be INTEGER_TYPE.
If we really wanted to require that, we'd need to change the gimplifier
to ensure that, which it isn't the case on the following testcase.
What is going on during the gimplification is that when we have the
(enum T) (p - q) cast, it is stripped through
/* Strip away as many useless type conversions as possible
at the toplevel. */
STRIP_USELESS_TYPE_CONVERSION (*expr_p);
and when the MODIFY_EXPR is gimplified, the *to_p has enum T type,
while *from_p has intptr_t type and as there is no conversion in between,
we just create GIMPLE_ASSIGN from that.
2021-01-09 Jakub Jelinek <jakub@redhat.com>
PR c++/98556
* tree-cfg.c (verify_gimple_assign_binary): Allow lhs of
POINTER_DIFF_EXPR to be any integral type.
* c-c++-common/pr98556.c: New test.
(cherry picked from commit 0188eab844eacda5edc6257771edb771844ae069)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/98556] [8/9 Regression] ICE: 'verify_gimple' failed since r8-4821-g1af4ebf5985ef2aa
2021-01-06 9:09 [Bug c++/98556] New: [11 Regression] ICE doko at debian dot org
` (10 preceding siblings ...)
2021-04-22 16:49 ` cvs-commit at gcc dot gnu.org
@ 2021-04-22 17:11 ` jakub at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-22 17:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98556
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 13+ messages in thread