public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/21684] New: MCore testsuite file gcc.c-torture/execute/lshrdi3-1.c compiles to incorrect assembly
@ 2005-05-20 20:30 winchester at amirix dot com
  2005-05-20 20:36 ` [Bug target/21684] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: winchester at amirix dot com @ 2005-05-20 20:30 UTC (permalink / raw)
  To: gcc-bugs

/opt/winchester/mcore/mcore-elf/bin/mcore-elf-gcc-4.0.0 -v --save-temps lshrdi-1.c
Using built-in specs.
Target: mcore-elf
Configured with: ../../src/gcc/gcc-4.0.0/configure --target=mcore-elf
--prefix=/opt/winchester/mcore/mcore-elf/ --enable-languages=c --with-newlib
Thread model: single
gcc version 4.0.0
 /opt/winchester/mcore/mcore-elf/bin/../libexec/gcc/mcore-elf/4.0.0/cc1 -E
-quiet -v -iprefix
/opt/winchester/mcore/mcore-elf/bin/../lib/gcc/mcore-elf/4.0.0/ lshrdi-1.c
-funsigned-bitfields -fpch-preprocess -o lshrdi-1.i
ignoring nonexistent directory
"/opt/winchester/mcore/mcore-elf/bin/../lib/gcc/mcore-elf/4.0.0/../../../../mcore-elf/sys-include"
ignoring duplicate directory
"/opt/winchester/mcore/mcore-elf//lib/gcc/mcore-elf/4.0.0/include"
ignoring nonexistent directory
"/opt/winchester/mcore/mcore-elf//lib/gcc/mcore-elf/4.0.0/../../../../mcore-elf/sys-include"
ignoring duplicate directory
"/opt/winchester/mcore/mcore-elf//lib/gcc/mcore-elf/4.0.0/../../../../mcore-elf/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/winchester/mcore/mcore-elf/bin/../lib/gcc/mcore-elf/4.0.0/include
 /opt/winchester/mcore/mcore-elf/bin/../lib/gcc/mcore-elf/4.0.0/../../../../mcore-elf/include
End of search list.
 /opt/winchester/mcore/mcore-elf/bin/../libexec/gcc/mcore-elf/4.0.0/cc1
-fpreprocessed lshrdi-1.i -funsigned-bitfields -quiet -dumpbase lshrdi-1.c
-auxbase lshrdi-1 -version -o lshrdi-1.s
GNU C version 4.0.0 (mcore-elf)
        compiled by GNU C version 3.3.5 (Debian 1:3.3.5-8).
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=129126
 /opt/winchester/mcore/mcore-elf/bin/../lib/gcc/mcore-elf/4.0.0/../../../../mcore-elf/bin/as
-o lshrdi-1.o lshrdi-1.s
 /opt/winchester/mcore/mcore-elf/bin/../libexec/gcc/mcore-elf/4.0.0/collect2 -X
/opt/winchester/mcore/mcore-elf/bin/../lib/gcc/mcore-elf/4.0.0/../../../../mcore-elf/lib/crt0.o
/opt/winchester/mcore/mcore-elf/bin/../lib/gcc/mcore-elf/4.0.0/crti.o
/opt/winchester/mcore/mcore-elf/bin/../lib/gcc/mcore-elf/4.0.0/crtbegin.o
-L/opt/winchester/mcore/mcore-elf/bin/../lib/gcc/mcore-elf/4.0.0
-L/opt/winchester/mcore/mcore-elf/bin/../lib/gcc
-L/opt/winchester/mcore/mcore-elf//lib/gcc/mcore-elf/4.0.0
-L/opt/winchester/mcore/mcore-elf/bin/../lib/gcc/mcore-elf/4.0.0/../../../../mcore-elf/lib
-L/opt/winchester/mcore/mcore-elf//lib/gcc/mcore-elf/4.0.0/../../../../mcore-elf/lib
lshrdi-1.o -lgcc -lc -lgcc -lsim
/opt/winchester/mcore/mcore-elf/bin/../lib/gcc/mcore-elf/4.0.0/crtend.o
/opt/winchester/mcore/mcore-elf/bin/../lib/gcc/mcore-elf/4.0.0/crtn.o


The assembly code for this is incorrect.  Specifically, the following gets
generated for variable_shift:

	.type	variable_shift, @function
variable_shift:
	subi	sp,32
	stw	r8,(sp,24)
	mov	r8,sp
	stw	r2,(r8)
	stw	r3,(r8,4)
	stw	r4,(r8,8)
	ldw	r7,(r8,8)
	movi	r6,32
	and	r7,r6
	cmpnei	r7,0
	jbf	.L2

### Here if we didn't jump to .L2 we are shifting by more than 32, so we should
just take the high word and shift it by (the shift value - 32), but we shift it
by the shift value itself, which results in 0.

	ldw	r6,(r8,4)
	ldw	r7,(r8,8)
	lsr	r6,r7
	stw	r6,(r8,16)
	movi	r7,0
	stw	r7,(r8,20)
	jbr	.L3

-- 
           Summary: MCore testsuite file gcc.c-torture/execute/lshrdi3-1.c
                    compiles to incorrect assembly
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: winchester at amirix dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: mcore-unknown-elf


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug target/21684] MCore testsuite file gcc.c-torture/execute/lshrdi3-1.c compiles to incorrect assembly
  2005-05-20 20:30 [Bug c/21684] New: MCore testsuite file gcc.c-torture/execute/lshrdi3-1.c compiles to incorrect assembly winchester at amirix dot com
@ 2005-05-20 20:36 ` pinskia at gcc dot gnu dot org
  2005-05-21 14:49 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-20 20:36 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target
           Keywords|                            |wrong-code


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug target/21684] MCore testsuite file gcc.c-torture/execute/lshrdi3-1.c compiles to incorrect assembly
  2005-05-20 20:30 [Bug c/21684] New: MCore testsuite file gcc.c-torture/execute/lshrdi3-1.c compiles to incorrect assembly winchester at amirix dot com
  2005-05-20 20:36 ` [Bug target/21684] " pinskia at gcc dot gnu dot org
@ 2005-05-21 14:49 ` pinskia at gcc dot gnu dot org
  2005-08-17 21:46 ` cvs-commit at gcc dot gnu dot org
  2005-08-17 21:54 ` wilson at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-21 14:49 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2005-
                   |                            |05/msg02109.html
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |patch
   Last reconfirmed|0000-00-00 00:00:00         |2005-05-21 14:49:43
               date|                            |


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug target/21684] MCore testsuite file gcc.c-torture/execute/lshrdi3-1.c compiles to incorrect assembly
  2005-05-20 20:30 [Bug c/21684] New: MCore testsuite file gcc.c-torture/execute/lshrdi3-1.c compiles to incorrect assembly winchester at amirix dot com
  2005-05-20 20:36 ` [Bug target/21684] " pinskia at gcc dot gnu dot org
  2005-05-21 14:49 ` pinskia at gcc dot gnu dot org
@ 2005-08-17 21:46 ` cvs-commit at gcc dot gnu dot org
  2005-08-17 21:54 ` wilson at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-08-17 21:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-08-17 21:44 -------
Subject: Bug 21684

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	wilson@gcc.gnu.org	2005-08-17 21:43:50

Modified files:
	gcc            : ChangeLog 
	gcc/config/mcore: mcore.h 

Log message:
	Fix misoptimization of mask and shift.
	PR target/21684
	* config/mcore/mcore.h (SHIFT_COUNT_TRUNCATED): Define to 0.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9764&r2=2.9765
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/mcore/mcore.h.diff?cvsroot=gcc&r1=1.77&r2=1.78



-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug target/21684] MCore testsuite file gcc.c-torture/execute/lshrdi3-1.c compiles to incorrect assembly
  2005-05-20 20:30 [Bug c/21684] New: MCore testsuite file gcc.c-torture/execute/lshrdi3-1.c compiles to incorrect assembly winchester at amirix dot com
                   ` (2 preceding siblings ...)
  2005-08-17 21:46 ` cvs-commit at gcc dot gnu dot org
@ 2005-08-17 21:54 ` wilson at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: wilson at gcc dot gnu dot org @ 2005-08-17 21:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wilson at gcc dot gnu dot org  2005-08-17 21:53 -------
Fixed on mainline.  I'm not adding the patch to the gcc-4.0 release branch
without test results, which I am not interested in trying to generate.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |wilson at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-05-21 14:49:43         |2005-08-17 21:53:54
               date|                            |


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-08-17 21:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-20 20:30 [Bug c/21684] New: MCore testsuite file gcc.c-torture/execute/lshrdi3-1.c compiles to incorrect assembly winchester at amirix dot com
2005-05-20 20:36 ` [Bug target/21684] " pinskia at gcc dot gnu dot org
2005-05-21 14:49 ` pinskia at gcc dot gnu dot org
2005-08-17 21:46 ` cvs-commit at gcc dot gnu dot org
2005-08-17 21:54 ` wilson at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).