diff options
author | Jeff Law <law@gcc.gnu.org> | 2018-05-23 16:33:36 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2018-05-23 16:33:36 -0600 |
commit | 2aece9c19970ad94abeeca4f85782f50799abdfc (patch) | |
tree | d012c1b4f1887cf875de320555ee7c20d52bdda6 /gcc | |
parent | 54fd159056765b65191e7685673133f34786b76c (diff) | |
download | gcc-2aece9c19970ad94abeeca4f85782f50799abdfc.zip gcc-2aece9c19970ad94abeeca4f85782f50799abdfc.tar.gz gcc-2aece9c19970ad94abeeca4f85782f50799abdfc.tar.bz2 |
re PR target/78849 (ICE on initialization of global struct containing __int20 array at varasm.c:4968)
PR target/78849
* gcc/tree.c (build_common_tree_nodes): Dont set TYPE_SIZE for __intN
types.
PR target/78849
* gcc.target/msp430/msp430.exp: Remove -pedantic-errors from
DEFAULT_CFLAGS.
* gcc.target/msp430/pr78849.c: New test.
From-SVN: r260627
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/msp430/msp430.exp | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/msp430/pr78849.c | 50 | ||||
-rw-r--r-- | gcc/tree.c | 2 |
5 files changed, 73 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 555a0f7..df282da 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,10 @@ -2017-05-23 Segher Boessenkool <segher@kernel.crashing.org> +2018-05-23 Jozef Lawrynowicz <jozef.l@somniumtech.com> + + PR target/78849 + * gcc/tree.c (build_common_tree_nodes): Dont set TYPE_SIZE for __intN + types. + +2018-05-23 Segher Boessenkool <segher@kernel.crashing.org> * doc/sourcebuild.texi (Endianness): New subsubsection. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 01bc8b1..fb4c74e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-05-23 Jozef Lawrynowicz <jozef.l@somniumtech.com> + + PR target/78849 + * gcc.target/msp430/msp430.exp: Remove -pedantic-errors from + DEFAULT_CFLAGS. + * gcc.target/msp430/pr78849.c: New test. + 2018-05-23 Marek Polacek <polacek@redhat.com> * g++.dg/cpp2a/range-for8.C: New test. diff --git a/gcc/testsuite/gcc.target/msp430/msp430.exp b/gcc/testsuite/gcc.target/msp430/msp430.exp index f34205b..0bd42c2 100644 --- a/gcc/testsuite/gcc.target/msp430/msp430.exp +++ b/gcc/testsuite/gcc.target/msp430/msp430.exp @@ -24,10 +24,15 @@ if { ![istarget msp430-*-*] } then { # Load support procs. load_lib gcc-dg.exp -# If a testcase doesn't have special options, use these. +# The '-pedantic-errors' option in the global variable DEFAULT_CFLAGS that is +# set by other drivers causes an error when the __int20 type is used, so remove +# this option from DEFAULT_CFLAGS for the msp430 tests. global DEFAULT_CFLAGS -if ![info exists DEFAULT_CFLAGS] then { - set DEFAULT_CFLAGS "" +if [info exists DEFAULT_CFLAGS] then { + set MSP430_DEFAULT_CFLAGS \ + [ string map { "-pedantic-errors" "" } $DEFAULT_CFLAGS ] +} else { + set MSP430_DEFAULT_CFLAGS "" } # Initialize `dg'. @@ -35,7 +40,7 @@ dg-init # Main loop. dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \ - "" $DEFAULT_CFLAGS + "" $MSP430_DEFAULT_CFLAGS # All done. dg-finish diff --git a/gcc/testsuite/gcc.target/msp430/pr78849.c b/gcc/testsuite/gcc.target/msp430/pr78849.c new file mode 100644 index 0000000..f70f0bb --- /dev/null +++ b/gcc/testsuite/gcc.target/msp430/pr78849.c @@ -0,0 +1,50 @@ +/* { dg-do compile } */ +/* { dg-final { scan-assembler ".size.*instance.*52" } } */ + +struct t_inner +{ + __int20 a; + char val1; + __int20 b[3]; + char val2; +}; + +struct t_full +{ + __int20 array[2]; + char val1; + struct t_inner bb[2]; + char val2; +}; + +struct t_full instance = +{ + { + 4231, + 3212, + }, + 5, + { + { + 87680, + 20, + { + 2534, + 3, + 41, + }, + 55, + }, + { + 567, + 4, + { + 43522, + 5433, + 454, + }, + 88, + }, + }, + 8, +}; @@ -9785,8 +9785,6 @@ build_common_tree_nodes (bool signed_char) { int_n_trees[i].signed_type = make_signed_type (int_n_data[i].bitsize); int_n_trees[i].unsigned_type = make_unsigned_type (int_n_data[i].bitsize); - TYPE_SIZE (int_n_trees[i].signed_type) = bitsize_int (int_n_data[i].bitsize); - TYPE_SIZE (int_n_trees[i].unsigned_type) = bitsize_int (int_n_data[i].bitsize); if (int_n_data[i].bitsize > LONG_LONG_TYPE_SIZE && int_n_enabled_p[i]) |