Bug 6034

Summary: ICE with -O1 and -g on mips (internal compiler error: in dwarf2out_var_location, at dwarf2out.c:20810)
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Hongxu Jia <hongxu.jia>
Component: devtools / tool chainAssignee: Hongxu Jia <hongxu.jia>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Low CC: bluelightning, liezhi.yang, Martin.Jansa, meta.mr.watcher, meta.watcher, raj.khem, richard.purdie, ross.burton, sgw
Version: 1.6   
Target Milestone: 1.8   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Hongxu Jia 2014-03-25 04:08:31 UTC
I have hit a ICE and could reduce it to the following minimal example:

1. Only the size of array assigned with 2 caused the issue:
$ cat > mipgcc-test.c << END

#include <stdio.h>

#define ARRAY_SIZE_MAX  2

int main (int argc, char **argv)
{
        char *pStrArry[ARRAY_SIZE_MAX] = {"hello"};
        int i = 0;

        while(pStrArry[i] && i<ARRAY_SIZE_MAX)
        {
                printf("%s\n", pStrArry[i]);
                i++;
        }

        return 0;
}

END

2. Only -O1 and -g on mips caused the issue:
$ mips-poky-linux-gcc -O1 -g -o mipgcc-test mipgcc-test.c
mipgcc-test.c: In function 'main':
mipgcc-test.c:18:1: internal compiler error: in dwarf2out_var_location, at dwarf2out.c:20810
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions
Comment 1 Hongxu Jia 2014-03-25 04:10:32 UTC
Also File the bug to GNU:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60643
Comment 2 Khem Raj 2014-10-17 10:41:20 UTC
(In reply to comment #1)
> Also File the bug to GNU:
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60643

This bug was marked as WORKSFORME mistakenly by upstream gcc developers
I have explained the issue more and gave a reason why upstream developers
testcase was wrong. Please reopen the bug upstream. I can not do this since I am not originator of bug.
Comment 3 Saul Wold 2014-11-13 16:22:39 UTC
Please follow-up on Khem's request to reopen this bug
Comment 4 Hongxu Jia 2014-12-02 02:26:47 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Also File the bug to GNU:
> > 
> > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60643
> 
> This bug was marked as WORKSFORME mistakenly by upstream gcc developers
> I have explained the issue more and gave a reason why upstream developers
> testcase was wrong. Please reopen the bug upstream. I can not do this since
> I am not originator of bug.

Hi Khem

I could not reopen it neither, it didn't have that option.
so choose 'unconfirmed' to instead
Comment 5 Khem Raj 2014-12-02 05:31:05 UTC
It seems to have been fixed upstream, can you back port below commit and retest

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9fcfed2eb95fea03d967dfcadd1eec9cbab4a744
Comment 6 Hongxu Jia 2014-12-02 05:34:18 UTC
(In reply to comment #5)
> It seems to have been fixed upstream, can you back port below commit and
> retest
> 
> https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;
> h=9fcfed2eb95fea03d967dfcadd1eec9cbab4a744

Got it, I am doing the test

//Hongxu
Comment 7 Hongxu Jia 2014-12-02 09:29:00 UTC
I have built core-image-sato-sdk and runqemu qemumips
to do the above testing.

The ICE defect doesn't exist on the current gcc
...
commit fd9fc495f12c78a4f62bda5919b2ef73c9584e0b
Author: Richard Purdie <richard.purdie@linuxfoundation.org>
Date:   Thu Nov 27 14:58:11 2014 +0000

    gcc-4.8: Drop unused patc
...

So I directly close these defect

//Hongxu