First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 21237
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Pawel Sikora <pluto@agmk.net>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
cryptcompress.i.bz2 testcase application/octet-stream 2005-04-26 16:46 94.90 KB Edit
cryptcompress.s.bz2 asm dump application/octet-stream 2005-04-26 16:48 28.71 KB Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 21237 depends on: Show dependency tree
Show dependency graph
Bug 21237 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2005-04-26 23:07 Opened: 2005-04-26 16:44
in function cryptcompress_truncate() from reiserfs4 patch  
compiler uses __cmpdi2 for old_size vs new_size (64 bit) comparision:  
  
 result = (old_size < new_size ? cryptcompress_append_hole(inode, new_size) :  
    prune_cryptcompress(inode, new_size, update_sd, aidx));  
  
in another case for simple foo() method gcc inlines __cmpdi2 equivalent:  
  
int foo(long long x, long long y) { return (x < y); }  
  
foo:    cmpw 7,5,3  
        li 0,0  
        bgt- 7,.L3  
        cmplw 6,6,4  
        beq- 7,.L6  
.L2:    mr 3,0  
        blr  
.L6:    ble- 6,.L2  
.L3:    li 0,1  
        mr 3,0  
        blr  
  
what decides which variant is chosen? 
is it possible to force inlining? 
 
# gcc-4.0.0+pr20973+pr21173

------- Comment #1 From Pawel Sikora 2005-04-26 16:46 -------
Created an attachment (id=8745) [edit]
testcase

------- Comment #2 From Pawel Sikora 2005-04-26 16:48 -------
Created an attachment (id=8746) [edit]
asm dump

------- Comment #3 From Andrew Pinski 2005-04-26 23:07 -------
Confirmed, reduced testcase:
int g(long long a, long long b)
{
  a -= b;
  return !a;
}

You were looking at the wrong function as we inline a function into cryptcompress_truncate which 
causes this.

One issue is when we go and expand (a - b) == 0, we expand it to cmpdi for some reason instead of 
inlining cmpdi.

------- Comment #4 From Pawel Sikora 2005-04-28 18:04 -------
__cmdi2 isn't used with -O0 but it is with -O1. 

------- Comment #5 From David Edelsohn 2005-05-07 20:24 -------
i386 synthesizes a DImode compare for 32-bit mode in target-dependent code. 
PowerPC probably needs to do the same.

------- Comment #6 From CVS Commits 2005-05-09 14:46 -------
Subject: Bug 21237

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dje@gcc.gnu.org	2005-05-09 14:45:59

Modified files:
	gcc            : ChangeLog 

Log message:
	PR middle-end/21237
	* dojump.c (do_jump, MINUS_EXPR): Build NE_EXPR and fall through
	to NE_EXPR case.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8673&r2=2.8674


------- Comment #7 From CVS Commits 2005-05-14 00:46 -------
Subject: Bug 21237

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	dje@gcc.gnu.org	2005-05-14 00:46:01

Modified files:
	gcc            : ChangeLog dojump.c 

Log message:
	PR middle-end/21237
	* dojump.c (do_jump, MINUS_EXPR): Build NE_EXPR and fall through
	to NE_EXPR case.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.244&r2=2.7592.2.245
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dojump.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.37&r2=1.37.8.1


------- Comment #8 From David Edelsohn 2005-05-14 00:48 -------
backported patch

First Last Prev Next    No search results available      Search page      Enter new bug