This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Proper way to make a one-off multi-file testcase?


We've encountered a bad code generation problem because of the way that
resource.c:mark_set_resources is ignorant of COND_EXEC patterns, which
ultimately results in a delay slot instruction clobbering a register
for the fall-through pass because find_dead_or_set_registers flags registers
set in a COND_EXEC just as dead as unconditionally set ones.

The core of the testcase is a function extracted from the linux kernel,
which has a number of inline functions.
(With some constant folding and asm pruning applied to make it readable
 and quasi-portable GNU C)
It has callers and callees which should not be inlined in order to reproduce
the bug.  I made up a trivial replacement set (the calling function being
'main') to allow for with the dejagnu harness, and put them in a separate
file.  There are a number of data structure definitions required, so I put
all that stuff that came from the header files back in a header file.

The test cae requires a specific set of optimization and code generation
options ( -O2 -mA7 -mlong-calls -fomit-frame-pointer ) to reproduce the error,
so from that point, the .dg framework seems best, as the it allows to select
specific options and also to make some or all of these dependent on a
particular target.
However, AFAIK having multiple source files is at odds with a simple test.
Will I have to create my own test directory and craft a custom expect script
to run the test, or is there an easier way?

Attachment: 20080119-1-getdents.c
Description: Text document

Attachment: 20080119-1-main.c
Description: Text document

Attachment: 20080119-1.h
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]