ICE error: unrecognizable insn

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

ICE error: unrecognizable insn

Pavel Pavlov

I just took latest svn cegcc and wanted to test if the loading error was fixed (the infamous problem that is only fixed by using upx).

But I can’t even compile my code, I’m getting ICE.

I googled for similar problems, some of them mentioned errno (and you may see from preprocessed file that my code uses it from), but I went to that errno.h and tried to comment out everything – same effect, doesn’t change anything.

However, it seems to be related to dllexport/dllimport:

Declaration of a symbol:

AVUTIL_API const AVPixFmtDescriptor av_pix_fmt_descriptors[];

 

And the error happens on this line:

 

 const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];

 

At the place of error AVUTIL_API expands to _declspec(dllimport). I tried to remove const, no change, but if I remove AVUTIL_API then everything compiles fine (but doesn’t link at the end, due to unresolved av_pix_fmt_descriptors.

 

See below for more info.

 

PS. What about that error, that binaries built with cegcc do not load on most modern devices? Is it fixed now?

thanks

 

 

 

At revision: 1441

 

Cegcc was built using cygwin’s Gcc (4.3.4 I think, the one that comes with cygwin)

 

arm-mingw32ce-gcc -DHAVE_AV_CONFIG_H -I. -I"/ffmpeg" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D

_LARGEFILE_SOURCE -D_WIN32_WCE -D__USE_W32_SOCKETS -DNDEBUG -DAV_LOG_MAXLEVEL=AV_LOG_ERROR -D_WIN32 -DFFMPEG_DLL -D_USRD

LL -D_WINDLL -std=c99 -I/opt/mingw32ce-trunk/arm-mingw32ce/include -I/ffmpeg/msvc9/include_ce -mcpu=arm1136j-s  -std=c99

 -fno-common -DUNICODE -D_UNICODE -fomit-frame-pointer -marm -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-

optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -O3 -

fno-math-errno -fno-signed-zeros -fno-tree-vectorize        -MMD -MF libavcodec/imgconvert.d -MT libavcodec/imgconvert.o

 -Dlibavcodec_EXPORTS -c -o libavcodec/imgconvert.o /ffmpeg/libavcodec/imgconvert.c

/ffmpeg/libavcodec/imgconvert.c: In function 'ff_fill_pointer':

/ffmpeg/libavcodec/imgconvert.c:666: error: unrecognizable insn:

(insn 10 9 11 3 /ffmpeg/libavcodec/imgconvert.c:573 (set (reg/f:SI 152)

        (symbol_ref:SI ("av_pix_fmt_descriptors") [flags 0x4c0] <var_decl 0x7ff99d18 av_pix_fmt_descriptors>)) -1 (nil))

 

/ffmpeg/libavcodec/imgconvert.c:666: internal compiler error: in extract_insn, at recog.c:2048

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

make: *** [libavcodec/imgconvert.o] Error 1

 

Using built-in specs.

Target: arm-mingw32ce

Configured with: /usr/local/CEGCC/cegcc-trunk/src/gcc-4.4.0/configure --with-gcc --with-gnu-ld --with-gnu-as --build=i68

6-pc-cygwin --target=arm-mingw32ce --host=i686-pc-cygwin --prefix=/opt/mingw32ce-trunk --enable-threads=win32 --disable-

nls --enable-languages=c,c++ --disable-win32-registry --disable-multilib --disable-interwork --without-newlib --enable-c

hecking --with-headers --disable-__cxa_atexit

Thread model: win32

gcc version 4.4.0 (GCC)

 

 

Preprocessed imgconvert.c  is attached in a zip

 


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

imgconvert.c.txt.zip (33K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Danny Backx
On Mon, 2010-02-08 at 21:24 -0500, Pavel Pavlov wrote:
> I just took latest svn cegcc and wanted to test if the loading error
> was fixed (the infamous problem that is only fixed by using upx).

Partially. It may work for you, give it a try.

> But I can’t even compile my code, I’m getting ICE.


> PS. What about that error, that binaries built with cegcc do not load
> on most modern devices? Is it fixed now?

Isn't that the same problem as you asked about at the beginning ?

> Preprocessed imgconvert.c  is attached in a zip

I had to edit one line to remove a syntax error, from
void (*butterflies_float)(float *restrict v1, float *restrict v2, int
len);
to
void (*butterflies_float)(float *v1, float *v2, int len);

After that, I got a similar error as you did.

Does anyone have a quick way of testing whether this happens also with a
native gcc 4.4.0 ?

        Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Pavel Pavlov
> > I just took latest svn cegcc and wanted to test if the loading error
> > was fixed (the infamous problem that is only fixed by using upx).
>
> Partially. It may work for you, give it a try.
>

Surprisingly, I got opposite behavior with the dll binaries compiled with latest cegcc: they load fine without upx compression and do not load at all if upx-compressed. Anyways, binaries compiled with the latest cegcc do not work when I use them (app crashes). When dlls are upx compressed at the time of loading of my app I'm seeing unaligned access error in vs debugger.


> > But I can’t even compile my code, I’m getting ICE.
>
>
> > PS. What about that error, that binaries built with cegcc do not load
> > on most modern devices? Is it fixed now?
>
> Isn't that the same problem as you asked about at the beginning ?


Yes, I wanted to see if the loading issue was fixed in latest binutils, but I wasn't able to compile my dll using latest cegcc. The email primarily related to the ICE error.


>
> > Preprocessed imgconvert.c  is attached in a zip
>
> I had to edit one line to remove a syntax error, from
> void (*butterflies_float)(float *restrict v1, float *restrict v2, int
> len);
> to
> void (*butterflies_float)(float *v1, float *v2, int len);
>
> After that, I got a similar error as you did.
>
> Does anyone have a quick way of testing whether this happens also with
> a
> native gcc 4.4.0 ?


I doubt that, this is latest svn code from ffmpeg and most likely native builds are done by many people using gcc440. I googled a similar error reported for cegcc a while ago and somebody mentioned that they forgot to apply some patch related to dllimport/dllexport. It could be related: if I remove dllimport attribute then I don't get any errors at all.



Other than that, I'm getting tons of warnings related to inline asm. Something like: Source R0 and R1 have to be different.
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Pavel Pavlov
> > > I just took latest svn cegcc and wanted to test if the loading
> error
> > > was fixed (the infamous problem that is only fixed by using upx).
> >
> > Partially. It may work for you, give it a try.
> >
>
> Surprisingly, I got opposite behavior with the dll binaries compiled
> with latest cegcc: they load fine without upx compression and do not
> load at all if upx-compressed. Anyways, binaries compiled with the
> latest cegcc do not work when I use them (app crashes). When dlls are
> upx compressed at the time of loading of my app I'm seeing unaligned
> access error in vs debugger.
>
>



I tried to compile latest cegcc svn version with export gcc_src=gcc which builds previous gcc instead of gcc4.4. Everything compiled well, but I still got the same unaligned access exception on startup. That's really unaligned access exception. The code was something like move r9 [r10] and r10/4 was XXXX.5, which means that r10 did not point to 4-byte aligned memory. Seems like it could be related to binutils?..
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Danny Backx
I trimmed down the file posted earlier to the source attached.

When you define macro CRASH, that's what the compiler does. See below.

I'll try to work further from here, but you're quite welcome to beat me
to it :-)

When running this with -v it is clear - if the error message wasn't
already - that the compiler itself is crashing. That's the thing that
creates an assembler file, which is then meant to be treated by the
assembler (as), part of binutils. It never gets to as.

        Danny

pavilion: {101} arm-mingw32ce-gcc -c -DCRASH k.c
k.c: In function 'ff_fill_linesize':
k.c:12: error: unrecognizable insn:
(insn 6 5 7 3 k.c:9 (set (reg/f:SI 136 [ av_pix_fmt_descriptors.0 ])
        (symbol_ref:SI ("av_pix_fmt_descriptors") [flags 0x440]
<var_decl 0xb7da9000 av_pix_fmt_descriptors>)) -1 (nil))
k.c:12: internal compiler error: in extract_insn, at recog.c:2048
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
pavilion: {102} arm-mingw32ce-gcc -c k.c
k.c:4: warning: array 'av_pix_fmt_descriptors' assumed to have one
element
pavilion: {103}

--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

k.c (262 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Danny Backx
On Wed, 2010-02-10 at 20:39 +0100, Danny Backx wrote:
> I trimmed down the file posted earlier to the source attached.
>
> When you define macro CRASH, that's what the compiler does. See below.
>
> I'll try to work further from here, but you're quite welcome to beat me
> to it :-)

I reported this to the gcc bug database, I have no clue where to look
for a solution.

        Danny

--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Vincent Richomme
In reply to this post by Danny Backx
On Wed, 10 Feb 2010 20:39:01 +0100, Danny Backx <[hidden email]>
wrote:
> I trimmed down the file posted earlier to the source attached.
>
> When you define macro CRASH, that's what the compiler does. See below.
>
> I'll try to work further from here, but you're quite welcome to beat me
> to it :-)
>
Why are you using specific gnu attribute instead of declspec ?
Wben using declspec, does it crash ?


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Danny Backx
On Thu, 2010-02-11 at 21:01 +0100, Vincent Richomme wrote:

> On Wed, 10 Feb 2010 20:39:01 +0100, Danny Backx <[hidden email]>
> wrote:
> > I trimmed down the file posted earlier to the source attached.
> >
> > When you define macro CRASH, that's what the compiler does. See below.
> >
> > I'll try to work further from here, but you're quite welcome to beat me
> > to it :-)
> >
> Why are you using specific gnu attribute instead of declspec ?

Because that was in the error reported.

> Wben using declspec, does it crash ?

Yes, the same error occurs.

        Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Pavel Pavlov
In reply to this post by Vincent Richomme
> > I'll try to work further from here, but you're quite welcome to beat
> me
> > to it :-)
> >
> Why are you using specific gnu attribute instead of declspec ?
> Wben using declspec, does it crash ?
>


That was preprocessed source. Original file had _declspec(dllimport/export)

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Vincent Richomme
In reply to this post by Danny Backx
Danny,

Could you give a link to your bugzilla report ?
Would it be difficult to apply cegcc changes to the latest gcc version
(gcc-4.4.3) ?


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Danny Backx
On Fri, 2010-02-12 at 11:37 +0100, Vincent Richomme wrote:
> Danny,
>
> Could you give a link to your bugzilla report ?

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43047

> Would it be difficult to apply cegcc changes to the latest gcc
version
> (gcc-4.4.3) ?

Maybe not difficult, but I am not sure what you hope to prove by that.
4.4.0 is not an old compiler.

        Danny

--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Pavel Pavlov
> > Danny,
> >
> > Could you give a link to your bugzilla report ?
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43047
>
> > Would it be difficult to apply cegcc changes to the latest gcc
> version
> > (gcc-4.4.3) ?
>
> Maybe not difficult, but I am not sure what you hope to prove by that.
> 4.4.0 is not an old compiler.
>
> Danny
>


What about the other problem (that I'm getting unaligned access on load)?
 I have src code that builds and works just fine with 4.1 build cegcc svn.1279. The only problem with that build is that the dll has something corrupt in the PE header and I fix it by upx-compressing it. But using latest trunk I'm getting unaligned access if the dll is built using either 4.3 and 4.1 builds of gcc (and upx compression does help also).
pS: I'm building ffmpeg using cegcc

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Danny Backx
On Fri, 2010-02-12 at 14:24 -0500, Pavel Pavlov wrote:

> > > Danny,
> > >
> > > Could you give a link to your bugzilla report ?
> >
> > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43047
> >
> > > Would it be difficult to apply cegcc changes to the latest gcc
> > version
> > > (gcc-4.4.3) ?
> >
> > Maybe not difficult, but I am not sure what you hope to prove by that.
> > 4.4.0 is not an old compiler.
> >
> > Danny
> >
>
>
> What about the other problem (that I'm getting unaligned access on load)?
>  I have src code that builds and works just fine with 4.1 build cegcc svn.1279. The only problem with that build is that the dll has something corrupt in the PE header and I fix it by upx-compressing it. But using latest trunk I'm getting unaligned access if the dll is built using either 4.3 and 4.1 builds of gcc (and upx compression does help also).
> pS: I'm building ffmpeg using cegcc

Can you send details about that ? I don't believe I've seen this.

Otherwise the highest priority I have is getting the ld crash fixed.

        Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Pavel Pavlov
> >
> > What about the other problem (that I'm getting unaligned access on
> load)?
> >  I have src code that builds and works just fine with 4.1 build cegcc
> svn.1279. The only problem with that build is that the dll has
> something corrupt in the PE header and I fix it by upx-compressing it.
> But using latest trunk I'm getting unaligned access if the dll is built
> using either 4.3 and 4.1 builds of gcc (and upx compression does help
> also).
> > pS: I'm building ffmpeg using cegcc
>
> Can you send details about that ? I don't believe I've seen this.
>
> Otherwise the highest priority I have is getting the ld crash fixed.
>


That's kind of difficult to do. I built huge project that contains MANY local changes and my own code. It's really difficult to minimize it to pinpoint source of problem. Moreover, it's time consuming to build cegcc and it also takes a lot of time to build my project.
I have some minor changes in cegcc by the way, but I doubt that they may have any impact:
I modified all *.def files and changed from coredll to coredll.dll instead (otherwise, all SW that links to coredll will stop working if somebody puts coredll.exe into windows folder).
When I get a crash I can't even see stack trace (I'm using visual studio). What can I do to see backtrace or print some extra helpful info? I'm getting app crash at the time my dll is loaded (app is built using ms VS, the dll is byult using cegcc)

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Vincent Richomme
In reply to this post by Danny Backx
On Fri, 12 Feb 2010 20:09:40 +0100, Danny Backx <[hidden email]>
wrote:

> On Fri, 2010-02-12 at 11:37 +0100, Vincent Richomme wrote:
>> Danny,
>>
>> Could you give a link to your bugzilla report ?
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43047
>
>> Would it be difficult to apply cegcc changes to the latest gcc
> version
>> (gcc-4.4.3) ?
>
> Maybe not difficult, but I am not sure what you hope to prove by that.
> 4.4.0 is not an old compiler.

Yeah you are right, I don't think gcc folks fix bugs in their minor
releases.


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|

Re: ICE error: unrecognizable insn

Johnny Willemsen
Hi,

> >> Could you give a link to your bugzilla report ?
> >
> > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43047
> >
> >> Would it be difficult to apply cegcc changes to the latest gcc
> > version
> >> (gcc-4.4.3) ?
> >
> > Maybe not difficult, but I am not sure what you hope to prove by that.
> > 4.4.0 is not an old compiler.
>
> Yeah you are right, I don't think gcc folks fix bugs in their minor
> releases.

Gcc 4.4.3 has a bug in its optimizer, which will cause problems for ACE, see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42871

Johnny


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel