User account creation filtered due to spam.

Bug 27499 - ICE with unsigned iteration variable and -fopenmp
Summary: ICE with unsigned iteration variable and -fopenmp
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.2.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code, monitored, openmp
Depends on:
Blocks:
 
Reported: 2006-05-08 16:34 UTC by Georg Baum
Modified: 2006-05-29 22:49 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-05-09 06:27:24


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Baum 2006-05-08 16:34:28 UTC
Now that the really baad OpenMP bugs seem to be fixed (thanhsk for that!) I have a hopefully easy one: I get an ICE (svn from today) for the following C code (and the C++ equivalent as well):

void f()
{
        unsigned int i;
        int dummy;
#pragma omp parallel for
        for (i = 0; i < 5; ++i)
                dummy = i;
}

LANG=C gcc-4.2 -c -fopenmp -o gcc-bug-signed.o gcc-bug-signed.c
gcc-bug-signed.c: In function 'f':
gcc-bug-signed.c:6: warning: iteration variable 'i' is unsigned
gcc-bug-signed.c:6: internal compiler error: in gimplify_omp_for, at gimplify.c:4753

FYI icc 8.1 flags the unsigned variable as error.
Comment 1 Andrew Pinski 2006-05-09 06:27:24 UTC
4753      gcc_assert (!TYPE_UNSIGNED (TREE_TYPE (decl)));

if (TYPE_UNSIGNED (TREE_TYPE (decl)))
    warning (0, "%Hiteration variable %qE is unsigned", &elocus, decl);

We only warn but then we assert it being false, what a joke.

Anyways confirmed.
Comment 2 Jakub Jelinek 2006-05-16 10:12:49 UTC
Subject: Bug 27499

Author: jakub
Date: Tue May 16 10:12:39 2006
New Revision: 113822

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113822
Log:
	PR c/27499
	* gimplify.c (gimplify_omp_for): Remove assertion that iteration var
	is signed.

	* gcc.dg/gomp/pr27499.c: New test.
	* g++.dg/gomp/pr27499.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/gomp/pr27499.C
    trunk/gcc/testsuite/gcc.dg/gomp/pr27499.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c
    trunk/gcc/testsuite/ChangeLog

Comment 3 Jakub Jelinek 2006-05-16 10:18:42 UTC
Fixed in SVN.