From 5ed418891b23588989460bc85fb53c60fbabbcbc Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Thu, 8 Jun 2017 12:38:27 +0000 Subject: [PATCH] re PR sanitizer/80932 (UBSAN: false positive as a result of distribution: c1*(c2*v1-c3*v2)=>c1*c2*v1-c1*c3*v2) PR sanitize/80932 * c-c++-common/ubsan/pr80932.c: Test with ints, not with long ints. From-SVN: r249010 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/c-c++-common/ubsan/pr80932.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 677b7d1d67c..59b25749f4b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-06-08 Marek Polacek + + PR sanitize/80932 + * c-c++-common/ubsan/pr80932.c: Test with ints, not with long ints. + 2017-08-08 Julia Koval PR target/73350,80862 diff --git a/gcc/testsuite/c-c++-common/ubsan/pr80932.c b/gcc/testsuite/c-c++-common/ubsan/pr80932.c index a833712d383..92903f7e0ee 100644 --- a/gcc/testsuite/c-c++-common/ubsan/pr80932.c +++ b/gcc/testsuite/c-c++-common/ubsan/pr80932.c @@ -4,10 +4,10 @@ int x = 1; -long int +int foo (void) { - return ((long) (13801962912760474560ULL * x) - (long) (15334142073106273231ULL * x)) * -6; + return ((int) (2855545792U * x) - (int) (3269399503U * x)) * -5; } int -- 2.30.2