From: Jakub Jelinek Date: Thu, 12 Oct 2017 07:22:12 +0000 (+0200) Subject: re PR sanitizer/82353 (runtime ubsan crash) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=281ff779cc1efadd5004248e7de6ef3cfc8c30df;p=gcc.git re PR sanitizer/82353 (runtime ubsan crash) PR target/82353 * gcc.target/i386/i386.exp (tests): Revert the '.C' extension change. * gcc.target/i386/pr82353.C: Moved to ... * g++.dg/ubsan/pr82353.C: ... here. Restrict to i?86/x86_64 && lp64. From-SVN: r253672 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a2daea4d8bd..c0d873daf0f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2017-10-12 Jakub Jelinek + + PR target/82353 + * gcc.target/i386/i386.exp (tests): Revert the '.C' extension change. + * gcc.target/i386/pr82353.C: Moved to ... + * g++.dg/ubsan/pr82353.C: ... here. Restrict to i?86/x86_64 && lp64. + 2017-10-11 Uros Bizjak * gcc.target/i386/387-ficom-2.c: New test. diff --git a/gcc/testsuite/g++.dg/ubsan/pr82353.C b/gcc/testsuite/g++.dg/ubsan/pr82353.C new file mode 100644 index 00000000000..a967cefa9cb --- /dev/null +++ b/gcc/testsuite/g++.dg/ubsan/pr82353.C @@ -0,0 +1,60 @@ +/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */ +/* { dg-options "-O2 -std=c++11 -fsanitize=undefined -fno-sanitize-recover=undefined -w -fdump-rtl-reload" } */ + +extern unsigned long tf_2_var_1, tf_2_var_21; +extern bool tf_2_var_2, tf_2_var_24, tf_2_var_6, tf_2_var_5; +extern unsigned char tf_2_var_16, tf_2_var_31; +extern short tf_2_var_69; +extern unsigned tf_2_var_233; +struct tf_2_struct_1 { + short member_1_0 : 27; + long member_1_1 : 10; +}; +struct a { + int member_2_0 : 5; +}; +struct tf_2_struct_3 { + static tf_2_struct_1 member_3_0; +}; +struct tf_2_struct_4 { + static unsigned member_4_0; + a member_4_1; +}; +struct tf_2_struct_5 { + tf_2_struct_1 member_5_2; + tf_2_struct_4 member_5_4; +}; +struct tf_2_struct_6 { + tf_2_struct_5 member_6_2; + short member_6_4; +} extern tf_2_struct_obj_2; +extern tf_2_struct_3 tf_2_struct_obj_8; +tf_2_struct_1 a; +tf_2_struct_5 b; +tf_2_struct_1 tf_2_struct_3::member_3_0; +unsigned tf_2_struct_4::member_4_0; +void tf_2_init() { + a.member_1_1 = tf_2_struct_obj_2.member_6_2.member_5_2.member_1_1 = 5; +} +void tf_2_foo() { + int c = tf_2_struct_obj_2.member_6_2.member_5_4.member_4_1.member_2_0 - + -~tf_2_struct_obj_2.member_6_4 * char(90284000534361); + tf_2_struct_obj_8.member_3_0.member_1_0 = + tf_2_var_24 > + tf_2_var_21 * a.member_1_0 * tf_2_var_2 - tf_2_var_5 % a.member_1_1; + if ((~(tf_2_var_31 * tf_2_var_6) && + -~tf_2_struct_obj_2.member_6_4 * 90284000534361) % + ~tf_2_var_31 * tf_2_var_6) + b.member_5_2.member_1_0 << tf_2_var_16 << tf_2_var_1; + tf_2_var_233 = -~tf_2_struct_obj_2.member_6_4 * char(90284000534361); + int d(tf_2_struct_obj_2.member_6_4); + if (b.member_5_2.member_1_0) + b.member_5_2.member_1_1 = c; + bool e(~-~tf_2_struct_obj_2.member_6_4); + a.member_1_1 % e; + if (tf_2_var_5 / tf_2_struct_obj_2.member_6_2.member_5_2.member_1_1) + b.member_5_4.member_4_0 = tf_2_var_21 * a.member_1_0 * tf_2_var_2; + tf_2_var_69 = tf_2_var_6; +} + +/* { dg-final { scan-rtl-dump-not "Inserting rematerialization insn" "reload" } } */ diff --git a/gcc/testsuite/gcc.target/i386/i386.exp b/gcc/testsuite/gcc.target/i386/i386.exp index 1dc37cdac12..eae253192ad 100644 --- a/gcc/testsuite/gcc.target/i386/i386.exp +++ b/gcc/testsuite/gcc.target/i386/i386.exp @@ -445,7 +445,7 @@ if [runtest_file_p $runtests $srcdir/$subdir/vect-args.c] { } # Everything else. -set tests [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] +set tests [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] set tests [prune $tests $srcdir/$subdir/vect-args.c] # Main loop. diff --git a/gcc/testsuite/gcc.target/i386/pr82353.C b/gcc/testsuite/gcc.target/i386/pr82353.C deleted file mode 100644 index 309bff764a4..00000000000 --- a/gcc/testsuite/gcc.target/i386/pr82353.C +++ /dev/null @@ -1,60 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -std=c++11 -fsanitize=undefined -fno-sanitize-recover=undefined -w -fdump-rtl-reload" } */ - -extern unsigned long tf_2_var_1, tf_2_var_21; -extern bool tf_2_var_2, tf_2_var_24, tf_2_var_6, tf_2_var_5; -extern unsigned char tf_2_var_16, tf_2_var_31; -extern short tf_2_var_69; -extern unsigned tf_2_var_233; -struct tf_2_struct_1 { - short member_1_0 : 27; - long member_1_1 : 10; -}; -struct a { - int member_2_0 : 5; -}; -struct tf_2_struct_3 { - static tf_2_struct_1 member_3_0; -}; -struct tf_2_struct_4 { - static unsigned member_4_0; - a member_4_1; -}; -struct tf_2_struct_5 { - tf_2_struct_1 member_5_2; - tf_2_struct_4 member_5_4; -}; -struct tf_2_struct_6 { - tf_2_struct_5 member_6_2; - short member_6_4; -} extern tf_2_struct_obj_2; -extern tf_2_struct_3 tf_2_struct_obj_8; -tf_2_struct_1 a; -tf_2_struct_5 b; -tf_2_struct_1 tf_2_struct_3::member_3_0; -unsigned tf_2_struct_4::member_4_0; -void tf_2_init() { - a.member_1_1 = tf_2_struct_obj_2.member_6_2.member_5_2.member_1_1 = 5; -} -void tf_2_foo() { - int c = tf_2_struct_obj_2.member_6_2.member_5_4.member_4_1.member_2_0 - - -~tf_2_struct_obj_2.member_6_4 * char(90284000534361); - tf_2_struct_obj_8.member_3_0.member_1_0 = - tf_2_var_24 > - tf_2_var_21 * a.member_1_0 * tf_2_var_2 - tf_2_var_5 % a.member_1_1; - if ((~(tf_2_var_31 * tf_2_var_6) && - -~tf_2_struct_obj_2.member_6_4 * 90284000534361) % - ~tf_2_var_31 * tf_2_var_6) - b.member_5_2.member_1_0 << tf_2_var_16 << tf_2_var_1; - tf_2_var_233 = -~tf_2_struct_obj_2.member_6_4 * char(90284000534361); - int d(tf_2_struct_obj_2.member_6_4); - if (b.member_5_2.member_1_0) - b.member_5_2.member_1_1 = c; - bool e(~-~tf_2_struct_obj_2.member_6_4); - a.member_1_1 % e; - if (tf_2_var_5 / tf_2_struct_obj_2.member_6_2.member_5_2.member_1_1) - b.member_5_4.member_4_0 = tf_2_var_21 * a.member_1_0 * tf_2_var_2; - tf_2_var_69 = tf_2_var_6; -} - -/* { dg-final { scan-rtl-dump-not "Inserting rematerialization insn" "reload" } } */