From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14599 invoked by alias); 4 May 2014 21:52:36 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 14577 invoked by uid 48); 4 May 2014 21:52:31 -0000 From: "guido at vanguardiasur dot com.ar" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/61050] OpenMP: wrong behavior of 'omp for' on corner cases Date: Sun, 04 May 2014 21:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: guido at vanguardiasur dot com.ar X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-05/txt/msg00219.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61050 --- Comment #2 from Guido Mart=C3=ADnez = --- (In reply to Jakub Jelinek from comment #1) > This is undefined behavior. > See OpenMP 4.0, 2.6, lines 18-26 on page 52: >=20 > "The following restrictions also apply: >=20 > - If test-expr is of the form var relational-op b and relational-op is < = or > <=3D then incr-expr must cause var to increase on each iteration of the l= oop. > If test-expr is of the form var relational-op b and relational-op is > or= >=3D > then incr-expr must cause var to decrease on each iteration of the loop. >=20 > - If test-expr is of the form b relational-op var and relational-op is < = or > <=3D then incr-expr must cause var to decrease on each iteration of the l= oop. > If test-expr is of the form b relational-op var and relational-op is > or= >=3D > then incr-expr must cause var to increase on each iteration of the loop." I see. I apologize for reporting this, then. >>From gcc-bugs-return-450528-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun May 04 22:57:08 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 5789 invoked by alias); 4 May 2014 22:57:07 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 5717 invoked by uid 48); 4 May 2014 22:57:01 -0000 From: "marcel at telka dot sk" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/42145] Incorrect "may be used uninitialized warning" for a very specific test case Date: Sun, 04 May 2014 22:57:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.5.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: marcel at telka dot sk X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-05/txt/msg00220.txt.bz2 Content-length: 1249 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42145 --- Comment #11 from Marcel Telka --- It is reproducible even with -O1: int f(void); int main(void) { int a, b; a = f(); if (a) b = f(); if (a && b) return 1; return 0; } $ gcc -O1 -Wuninitialized -c a.c a.c: In function 'main': a.c:12:15: warning: 'b' may be used uninitialized in this function [-Wmaybe-uninitialized] if (a && b) ^ $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/lto-wrapper Target: sparc-sun-solaris2.11 Configured with: /ws/builds2/jenkins/src/du/dilos-userland-review/components/gcc48/gcc-4.8.2/configure --prefix=/usr/gcc/4.8 --mandir=/usr/gcc/4.8/share/man --bindir=/usr/gcc/4.8/bin --libdir=/usr/gcc/4.8/lib --sbindir=/usr/gcc/4.8/sbin --infodir=/usr/share/info --without-gnu-as --with-as=/usr/bin/as --build=sparc-sun-solaris2.11 --infodir=/usr/gcc/4.8/share/info --libexecdir=/usr/gcc/4.8/lib --enable-languages=c,c++,fortran,objc --enable-shared --enable-targets=sparcv9-sun-solaris2.11 --without-gnu-ld --with-ld=/usr/bin/ld Thread model: posix gcc version 4.8.2 (GCC) $