[Bug target/60556] tip of tree crash with mips compiler

2014-03-19 Thread reed.kotler at imgtec dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60556

--- Comment #14 from reed kotler  ---
(In reply to Andrew Pinski from comment #13)
> (In reply to reed kotler from comment #12)
> > 
> > Do you know where the original line was that made it fail in the .ii?
> 
> Yes:
> # 227 "/home/rkotler/llvm_trunk/lib/ExecutionEngine/RTDyldMemoryManager.cpp"
>   if (Name == "stat") return (uint64_t)&stat;
>   if (Name == "fstat") return (uint64_t)&fstat;
>   if (Name == "lstat") return (uint64_t)&lstat;
>   if (Name == "stat64") return (uint64_t)&stat64;
>   if (Name == "fstat64") return (uint64_t)&fstat64;
>   if (Name == "lstat64") return (uint64_t)&lstat64;
>   if (Name == "atexit") return (uint64_t)&atexit;
>   if (Name == "mknod") return (uint64_t)&mknod;
> # 254 "/home/rkotler/llvm_trunk/lib/ExecutionEngine/RTDyldMemoryManager.cpp"
>   if (Name == "__main") return (uint64_t)&jit_noop;
> 
> 
> You can just cast them to unsigned long before casting them to uint64_t for
> the work around.

Great!

This code is from LLVM. By making this change I can build a working llvm using
gcc cross and native.

Do we have any idea when the gcc will be fixed so I don't need to this
workaround?


[Bug c++/60556] New: tip of tree crash with mips compiler

2014-03-17 Thread reed.kotler at imgtec dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60556

Bug ID: 60556
   Summary: tip of tree crash with mips compiler
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reed.kotler at imgtec dot com

Attached is .ii file and .sh to run the compiler.

This is a compiler I've built with tip of tree sources.

rkotler@mipssw006:~/slave/gccbugx86/build/lib/ExecutionEngine$ bash doit.sh
/home/rkotler/llvm_trunk/lib/ExecutionEngine/RTDyldMemoryManager.cpp: In member
function 'virtual void*
llvm::RTDyldMemoryManager::getPointerToNamedFunction(const string&, bool)':
/home/rkotler/llvm_trunk/lib/ExecutionEngine/RTDyldMemoryManager.cpp:227:41:
internal compiler error: Segmentation fault
   if (Name == "stat") return (uint64_t)&stat;
 ^
0xb0acbf crash_signal
 /home/rkotler/slave/slavebuildgccbe/build/src/gcc/gcc/toplev.c:337
0x8960bb emit_move_insn(rtx_def*, rtx_def*)
 /home/rkotler/slave/slavebuildgccbe/build/src/gcc/gcc/expr.c:3609
0x899379 convert_move(rtx_def*, rtx_def*, int)
/home/rkotler/slave/slavebuildgccbe/build/src/gcc/gcc/expr.c:567
0x8997da convert_modes(machine_mode, machine_mode, rtx_def*, int)
/home/rkotler/slave/slavebuildgccbe/build/src/gcc/gcc/expr.c:798
0x8a458a expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
 /home/rkotler/slave/slavebuildgccbe/build/src/gcc/gcc/expr.c:8203
0x7bc783 expand_gimple_stmt_1
 /home/rkotler/slave/slavebuildgccbe/build/src/gcc/gcc/cfgexpand.c:3252
0x7bc783 expand_gimple_stmt
 /home/rkotler/slave/slavebuildgccbe/build/src/gcc/gcc/cfgexpand.c:3312
0x7bd9e7 expand_gimple_basic_block
 /home/rkotler/slave/slavebuildgccbe/build/src/gcc/gcc/cfgexpand.c:5152
0x7c0119 gimple_expand_cfg
 /home/rkotler/slave/slavebuildgccbe/build/src/gcc/gcc/cfgexpand.c:5731
0x7c0119 execute
 /home/rkotler/slave/slavebuildgccbe/build/src/gcc/gcc/cfgexpand.c:5951
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
rkotler@mipssw006:~/slave/gccbugx86/build/lib/ExecutionEngine$


[Bug c++/60556] tip of tree crash with mips compiler

2014-03-17 Thread reed.kotler at imgtec dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60556

--- Comment #1 from reed kotler  ---
Created attachment 32377
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32377&action=edit
.sh file to run the compiler


[Bug target/60556] tip of tree crash with mips compiler

2014-03-17 Thread reed.kotler at imgtec dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60556

--- Comment #4 from reed kotler  ---
it's too big.

what do you suggest?

Where should i put it?

1200k bytes


[Bug target/60556] tip of tree crash with mips compiler

2014-03-17 Thread reed.kotler at imgtec dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60556

--- Comment #6 from reed kotler  ---
(In reply to Andrew Pinski from comment #3)
> Also how did you configure your compiler?

  $ /home/rkotler/slave/slavebuildgccbe/build/src/gcc/configure
--prefix=/home/r
kotler/slave/slavebuildgccbe/build/install-mips-mti-linux-gnu --disable-libssp
-
-disable-libgomp --disable-libmudflap --disable-fixed-point
--disable-decimal-fl
oat --with-mips-plt --target=mips-mti-linux-gnu --enable-languages=c
--with-newl
ib --without-headers --disable-shared --disable-threads --disable-libquadmath
--
disable-libatomic


  $ /home/rkotler/slave/slavebuildgccbe/build/src/gcc/libatomic/configure
--cach
e-file=./config.cache --enable-multilib
--with-cross-host=x86_64-unknown-linux-g
nu
--prefix=/home/rkotler/slave/slavebuildgccbe/build/install-mips-mti-linux-gnu
 --disable-libssp --disable-libgomp --disable-libmudflap --disable-fixed-point
-
-disable-decimal-float --with-mips-plt --enable-__cxa_atexit
--with-sysroot=/hom
e/rkotler/slave/slavebuildgccbe/build/install-mips-mti-linux-gnu/sysroot
--with-
build-sysroot=/home/rkotler/slave/slavebuildgccbe/build/install-mips-mti-linux-g
nu/sysroot --enable-languages=c,c++,lto
--program-transform-name=s&^&mips-mti-li
nux-gnu-& --disable-option-checking --with-target-subdir=mips-mti-linux-gnu
--bu
ild=x86_64-unknown-linux-gnu --host=mips-mti-linux-gnu
--target=mips-mti-linux-g
nu --srcdir=/home/rkotler/slave/slavebuildgccbe/build/src/gcc/libatomicq


[Bug target/60556] tip of tree crash with mips compiler

2014-03-17 Thread reed.kotler at imgtec dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60556

--- Comment #7 from reed kotler  ---
Created attachment 32378
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32378&action=edit
.ii gziped


[Bug target/60556] tip of tree crash with mips compiler

2014-03-17 Thread reed.kotler at imgtec dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60556

--- Comment #9 from reed kotler  ---
(In reply to Andrew Pinski from comment #8)
> I can reproduce the bug and now I am reducing it.

Awesome! Thanks.


[Bug target/60556] tip of tree crash with mips compiler

2014-03-17 Thread reed.kotler at imgtec dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60556

--- Comment #12 from reed kotler  ---
(In reply to Andrew Pinski from comment #11)
> (In reply to Andrew Pinski from comment #10)
> > I should note the code is undefined and has (uint64_t)&stat and that itself
> > is causing the issue.  If I change it to be
> > (uint64_t)(unsigned long)&stat, GCC does not crash.
> 
> But using long instead of unsigned long causes the crash.
> 
> Reduced testcase:
> int g (int);
> unsigned long long f(void) {
>  return (unsigned long long)(long)&g;
> }
> 
> This happens with both the C and C++ front-ends.

Thanks.

Do you know where the original line was that made it fail in the .ii?

Depending on the location, I can possibly make the source change for now until
the bug gets fixed in gcc.