Bug 616050
Summary: | Missing or partial location expressions | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Mark Wielaard <mjw> | ||||||||
Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Michal Nowak <mnowak> | ||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | low | ||||||||||
Version: | 6.0 | CC: | aoliva, dbhole, ebachalo, fche, jon.vanalten, jpechane, langel, lkundrak, mjw, mnowak, ohudlick, pmuller, syeghiay, wcohen | ||||||||
Target Milestone: | rc | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | All | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | gcc-4.4.4-13.el6 | Doc Type: | Bug Fix | ||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | 613824 | ||||||||||
: | 653998 (view as bug list) | Environment: | |||||||||
Last Closed: | 2010-11-10 20:25:06 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Bug Depends On: | 613822, 613824 | ||||||||||
Bug Blocks: | 653998 | ||||||||||
Attachments: |
|
Description
Mark Wielaard
2010-07-19 14:30:10 UTC
This issue has been proposed when we are only considering blocker issues in the current Red Hat Enterprise Linux release. It has been denied for the current Red Hat Enterprise Linux release. ** If you would still like this issue considered for the current release, ask your support representative to file as a blocker on your behalf. Otherwise ask that it be considered for the next Red Hat Enterprise Linux release. ** Created attachment 432914 [details]
preprocessed sources
Produced with:
g++ -DLINUX -D_GNU_SOURCE -DAMD64 -DPRODUCT -I. -I../generated/adfiles -I../generated/jvmtifiles -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/asm -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/ci -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/classfile -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/code -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/compiler -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/gc_implementation -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/gc_implementation/parNew -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/gc_implementation/g1 -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/gc_implementation/shared -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/gc_interface -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/interpreter -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/libadt -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/memory -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/oops -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/opto -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/prims -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/runtime -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/services -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/shark -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/utilities -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/cpu/x86/vm -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/os/linux/vm -I/usr/local/build/icedtea6-obj/openjdk/hotspot/src/os_cpu/linux_x86/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"17.0-b16\"" -DHOTSPOT_BUILD_TARGET="\"product\"" -DHOTSPOT_BUILD_USER="\"mark\"" -DHOTSPOT_LIB_ARCH=\"amd64\" -DJRE_RELEASE_VERSION="\"1.6.0_20-b20\"" -DHOTSPOT_VM_DISTRO="\"OpenJDK\"" -DDERIVATIVE_ID="\"IcedTea6 1.9pre+rb4455c6c313f\"" -DDISTRIBUTION_ID="\"Built on Red Hat Enterprise Linux Workstation release 6.0 Beta (Santiago) (Mon Jul 19 10:49:35 CEST 2010)\"" -DCOMPILER2 -fpic -fno-rtti -fno-exceptions -D_REENTRANT -fcheck-new -m64 -pipe -g -O3 -fno-strict-aliasing -DVM_LITTLE_ENDIAN -D_LP64=1 -fno-omit-frame-pointer -Werror -Wpointer-arith -Wsign-compare -DDTRACE_ENABLED -c -o nmethod.E -E -dA -fverbose-asm /usr/local/build/icedtea6-obj/openjdk/hotspot/src/share/vm/code/nmethod.cpp
Created attachment 433107 [details]
gcc44-rh616050-arg8.patch
The missing arg8 location can be fixed by attached patch, the expressions are just too large and trigger the maximum depth 5 check. This is something I have in my entry value patchset for months.
Now that we don't blindly create RTL during expansion, but first test whether it can actually lead to useful location, I think it is not so pricey to allow larger limit, perhaps we could go even to 10 or so.
I see the arg2 issue too (this one in all 3 spots), looking into that now.
Created attachment 433112 [details]
gcc44-rh616050-arg2.patch
Fix for the other problem. We were using ZERO_EXTEND vs. SIGN_EXTEND incorrectly in DEBUG_INSNs - for DEBUG argn22 => (int) D.157339D.157339->_length
where _length field is unsigned short we were using SIGN_EXTEND instead of ZERO_EXTEND in DEBUG_INSN, while the actual code was of course using ZERO_EXTEND and thus when the memory value was loaded and zero extended into a register after the DEBUG_INSN, we concluded the value is no longer available.
Of course, even for mismatching ZERO_EXTEND vs. SIGN_EXTEND when it is really needed in some code we could do something, but it might be expensive (for values containing outermost ZERO_EXTEND or SIGN_EXTEND we could also record the inner VALUE lives in inner part of some register).
Anyway, this patch should be sufficient now.
Both fixes now approved and committed upstream (for GCC 4.6). For QA, artificial testcases distilled from this bugreport (both will be included in the testsuite run during %check): /* PR debug/45003 */ /* { dg-do run { target { x86_64-*-* && lp64 } } } */ /* { dg-options "-g" } */ int __attribute__((noinline)) foo (unsigned short *p) { int a = *p; asm volatile ("nop"); asm volatile ("nop" : : "D" (a)); /* { dg-final { gdb-test 10 "a" "0x8078" } } */ return 0; } int __attribute__((noinline)) bar (short *p) { unsigned int a = *p; asm volatile ("nop"); asm volatile ("nop" : : "D" (a)); /* { dg-final { gdb-test 19 "a" "0xffff8078" } } */ return 0; } int main () { unsigned short us = 0x8078; foo (&us); short s = -32648; bar (&s); return 0; } and /* { dg-do run } */ /* { dg-options "-g" } */ struct A { int x; unsigned short y; char z[64]; }; void __attribute__((noinline)) foo (struct A *p, char *q) { int f = &p->z[p->y] - q; asm volatile ("nop"); asm volatile ("nop" : : "g" (f)); /* { dg-final { gdb-test 12 "f" "14" } } */ asm volatile ("" : : "g" (p), "g" (q)); } int main () { struct A a; __builtin_memset (&a, 0, sizeof a); a.y = 26; a.x = 12; asm volatile ("" : : "r" (&a) : "memory"); foo (&a, &a.z[a.x]); return 0; } The first test is x86_64 specific, the other one is not. gdb-test means on that line check value of that variable (a resp. f) is equal to the last operand. Fixed in gcc-4.4.4-13.el6. openjdk still needs to be rebuilt with that. Hi, Any chance this fix could be ported to current Fedora releases? thanks, jon It of course is, see gcc-4.4.4-13.fc{12,13}. Just it hasn't been pushed as update yet, and won't be until bugfixes accumulate a little bit (-10.fc{12,13} is currently released). The guality.exp tests are cycled through various -O* optimization levels. This bug was in VTA, which isn't enabled at all at -O0, so it is expected the test passed before/after the patch at -O0 -g (as the patch didn't change anything in generated code or debug info for that). It is -O1 -g and higher (or perhaps just -O2 -g or -O3 -g) that matters here. Red Hat Enterprise Linux 6.0 is now available and should resolve the problem described in this bug report. This report is therefore being closed with a resolution of CURRENTRELEASE. You may reopen this bug report if the solution does not work for you. |