[Bug debug/82202] Missing debug information in LTO/offload compilation

2020-09-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82202

--- Comment #3 from Richard Biener  ---
I fixed this for GCC 10, can you re-check?

[Bug debug/82202] Missing debug information in LTO/offload compilation

2019-04-11 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82202

Richard Biener  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #2 from Richard Biener  ---
Just noticed this recently again - we need explict -g at link-time to get
debuginfo for an LTO compilation.  IMHO that's a serious issue people might
run into (now that we handle optimization transparently).

[Bug debug/82202] Missing debug information in LTO/offload compilation

2017-09-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82202

Richard Biener  changed:

   What|Removed |Added

   Keywords||lto
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-09-13
 CC||rguenth at gcc dot gnu.org
Summary|Missing debug information   |Missing debug information
   |in offloading compilation   |in LTO/offload compilation
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
The same is true for LTO:

> cat t.c
int main() { return 0; }
> gcc-7 t.c -flto -c -g -Wstrict-overflow
> gcc-7 t.o
> readelf -w a.out | grep main
> gcc-7 t.o -g
> readelf -w a.out | grep main
<189>   DW_AT_name: (indirect string, offset: 0x248): main
  0x0240 666c7472 616e7300 6d61696e 0073697a fltrans.main.siz

-g options are handled the same as -W ones, they are not streamed nor merged:

> readelf -x 10 t.o

Hex dump of section '.gnu.lto_.opts':
  0x 272d666d 6174682d 6572726e 6f272027 '-fmath-errno' '
  0x0010 2d667369 676e6564 2d7a6572 6f732720 -fsigned-zeros' 
  0x0020 272d6674 72617070 696e672d 6d617468 '-ftrapping-math
  0x0030 2720272d 666e6f2d 74726170 76272027 ' '-fno-trapv' '
  0x0040 2d666e6f 2d737472 6963742d 6f766572 -fno-strict-over
  0x0050 666c6f77 2720272d 666e6f2d 6f70656e flow' '-fno-open
  0x0060 6d702720 272d666e 6f2d6f70 656e6163 mp' '-fno-openac
  0x0070 63272027 2d6d7475 6e653d67 656e6572 c' '-mtune=gener
  0x0080 69632720 272d6d61 7263683d 7838362d ic' '-march=x86-
  0x0090 36342720 272d666c 746f2700  64' '-flto'.