[PR87793] reject non-toplevel unspecs in debug loc exprs on x86
Before revision 254025, we'd reject UNSPECs in debug loc exprs. TARGET_CONST_NOT_OK_FOR_DEBUG_P still rejects that by default, on all ports that override it, except for x86, that accepts @gotoff unspecs. We can indeed accept them in top-level expressions, but not as subexpressions: the assembler rejects the difference between two @gotoff symbols, for example. We could simplify such a difference and drop the @gotoffs, provided that the symbols are in the same section; we could also accept @gotoffs plus literal constants. However, accepting those but rejecting such combinations as subexpressions would be ugly, and most likely not worth the trouble: sym@gotoff+litconst hardly makes sense as a standalone expression, and the difference between @gotoffs should be avoided to begin with, as follows. Ideally, the debug loc exprs would use the symbolic data in REG_EQUIV/REG_EQUAL notes, or delegitimized addresses, instead of simplifying the difference between two legitimized addresses so that the occurrences of the GOT register cancel each other. That would require some more elaborate surgery in var-tracking and cselib than would be appropriate at this stage. for gcc/ChangeLog PR target/87793 * config/i386/i386.c (ix86_const_not_ok_for_debug_p): Reject non-toplevel UNSPEC. for gcc/testsuite/ChangeLog PR target/87793 * gcc.dg/pr87793.c: New. From-SVN: r265956
Showing
gcc/testsuite/gcc.dg/pr87793.c
0 → 100644
Please
register
or
sign in
to comment