Bug 15445 - spurious dependency-violation warnings
Summary: spurious dependency-violation warnings
Status: ASSIGNED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: unknown
: P2 normal
Target Milestone: ---
Assignee: Jim Wilson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-14 18:28 UTC by davidm
Modified: 2006-10-14 23:29 UTC (History)
3 users (show)

See Also:
Host: ia64-linux
Target: ia64-linux
Build: ia64-linux
Known to work:
Known to fail:
Last reconfirmed: 2005-07-05 02:32:47


Attachments
testcase (854 bytes, text/plain)
2006-10-14 21:55 UTC, Martin Michlmayr
Details
testcase (469 bytes, text/plain)
2006-10-14 22:17 UTC, Martin Michlmayr
Details
testcase (537 bytes, text/plain)
2006-10-14 23:29 UTC, Martin Michlmayr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description davidm 2004-05-14 18:28:20 UTC
There are corner-cases in which the GCC backend for ia64 generates code which,
to the assembler, looks as if there were a dependency-violation.  Basically, the
assembler doesn't have enough information to assert the validity/safety of the
code and it hence issues a warning message, which are usually (always?)
spurious.  It is difficult to give a specific test-case because small changes in
the compiler can result in different code and hence the problem keeps moving
around from release to release.  My recommendation is to build the Linux kernel
and to watch for any dependency-violation messages from the assembler.  With a
pre-release of GCC v3.5, the following example of such a spurious dependency
violation was observed:

Source file: net/drivers/bonding/bond_main.c

Warning message:

$ as -x drivers/net/bonding/bond_main.s
drivers/net/bonding/bond_main.s: Assembler messages:
drivers/net/bonding/bond_main.s:3409: Warning: Use of 'addl' may violate WAW
dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 42
drivers/net/bonding/bond_main.s:3408: Warning: This is the location of the
conflicting usage

Code in question:

	cmp4.eq p12, p13 = 6, r14
	addl r28 = @ltoffx(.LC26), r1
	mov r40 = r32 ;;

  (p13) cmp.eq p16, p17 = 0, r34
	ld8.mov r41 = [r28], .LC26
  (p12) br.cond.dpnt .L1108 ;;

  (p16) addl r42 = @ltoffx(.LC28), r1
  (p17) addl r42 = @ltoffx(.LC27), r1
Comment 1 Andrew Pinski 2004-05-14 19:03:04 UTC
If that is the case why are you reporting this bug to GCC when you should be reporting it to 
binutils, they have their own bugzilla at >http://sources.redhat.com/bugzilla/>.
Comment 2 davidm 2004-05-14 19:17:28 UTC
Sorry if I wasn't being clear.  There is nothing the assembler can do about it
(short of solving the halting problem).  This needs to be handled at the GCC
level (e.g., by emitting .pred.rel.mutex directives as necessary).

BTW: I'm submitted this bug-report per request from Jim Wilson.
Comment 3 Jim Wilson 2004-05-16 23:46:54 UTC
This is partly a compiler problem, and partly a binutils problem.  This bug
exists to document the fact that gcc/gas don't handle dependency violation
issues correctly in all instances.

I don't plan to work on this immediately, but at least assigning it to me makes
it clear who to ask if there are questions about this bug.
Comment 4 Martin Michlmayr 2006-09-19 14:36:20 UTC
(In reply to comment #3)
> This is partly a compiler problem, and partly a binutils problem.  This bug
> exists to document the fact that gcc/gas don't handle dependency violation
> issues correctly in all instances.
> 
> I don't plan to work on this immediately, but at least assigning it to me makes
> it clear who to ask if there are questions about this bug.

Do you have any plans to work on this in the near future?  Would it help it have
some testcases?  I noticed a number of such warnings while compiling the Debian
archive with gcc 4.2.  Some appear to be regressions from 3.4.
Comment 5 Martin Michlmayr 2006-10-14 21:55:10 UTC
Created attachment 12431 [details]
testcase

tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c gqmpeg-ui2_display.c
tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c -O2 gqmpeg-ui2_display.c
/tmp/ccxbqBMW.s: Assembler messages:
/tmp/ccxbqBMW.s:91: Warning: Use of 'adds' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 14
/tmp/ccxbqBMW.s:90: Warning: This is the location of the conflicting usage
/tmp/ccxbqBMW.s:95: Warning: Use of 'ld8' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 8
/tmp/ccxbqBMW.s:94: Warning: This is the location of the conflicting usage
tbm@coconut0:~$ gcc-3.4 -c -O2 gqmpeg-ui2_display.c
tbm@coconut0:~$
Comment 6 Martin Michlmayr 2006-10-14 22:17:29 UTC
Created attachment 12432 [details]
testcase

tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c sfront-readmidi.c
tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c -O2 sfront-readmidi.c
/tmp/ccJHp78N.s: Assembler messages:
/tmp/ccJHp78N.s:55: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 16
/tmp/ccJHp78N.s:55: Warning: Only the first path encountering the conflict is reported
/tmp/ccJHp78N.s:54: Warning: This is the location of the conflicting usage
tbm@coconut0:~$ gcc-3.4 -c -O2 sfront-readmidi.c
tbm@coconut0:~$
Comment 7 Martin Michlmayr 2006-10-14 23:29:49 UTC
Created attachment 12433 [details]
testcase

tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c nethack-cmd.c
tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c -O2 nethack-cmd.c
nethack-cmd.c: In function 'enlightenment':
nethack-cmd.c:44: warning: passing argument 1 of 'enlght_combatinc' makes integer from pointer without a cast
/tmp/ccS5a0sQ.s: Assembler messages:
/tmp/ccS5a0sQ.s:228: Warning: Use of 'addl' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 33
/tmp/ccS5a0sQ.s:228: Warning: Only the first path encountering the conflict is reported
/tmp/ccS5a0sQ.s:226: Warning: This is the location of the conflicting usage
/tmp/ccS5a0sQ.s:240: Warning: Use of 'ld8.mov' may violate RAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 33
/tmp/ccS5a0sQ.s:239: Warning: This is the location of the conflicting usage
/tmp/ccS5a0sQ.s:240: Warning: Use of 'ld8.mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 33
/tmp/ccS5a0sQ.s:239: Warning: This is the location of the conflicting usage
tbm@coconut0:~$ gcc-3.4 -c -O2 nethack-cmd.c
In file included from nethack-cmd.c:44:
nethack-cmd.c: In function `enlightenment':
nethack-cmd.c:25: warning: passing arg 1 of `enlght_combatinc' makes integer from pointer without a cast
tbm@coconut0:~$