On 07/12/2011 07:46 PM, Jakub Jelinek wrote:
The aim is to include just (or primarily) code generation affecting options explicitly passed on the command line. So that the merging actually works, options or arguments which include filenames or paths shouldn't be added, on Roland's request -D*/-U* options aren't added either (that should be covered by .debug_macinfo)
...but only with -g3.
Ideally we'd just include explicitly passed options from command line that haven't been overridden by other command line options, and would sort them, so that there are higher chances of DW_AT_producer strings being merged (e.g. -O2 -ffast-math vs. -ffast-math -O2 are now different strings, and similarly -O2 vs. -O3 -O2 vs. -O0 -O1 -Ofast -O2), but I'm not sure if it is easily possible using current option handling framework.
Why not? Sorting sounds pretty straightforward to me, though you might want to copy the array first.
On the other hand, it probably isn't worthwhile; presumably most relocatables being linked together will share the same CFLAGS, so you'll get a high degree of merging without any sorting.
--- gcc/testsuite/lib/dg-pch.exp.jj 2011-01-03 18:58:03.000000000 +0100 +++ gcc/testsuite/lib/dg-pch.exp 2011-07-12 23:13:50.943670171 +0200 - dg-test -keep-output "./$bname$suffix" "$otherflags $flags" "" + dg-test -keep-output "./$bname$suffix" "-gno-record-gcc-switches $otherflags $flags" ""
Why is this necessary? Jason