This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Help on emitting static constant arrays
- From: FX Coudert <fxcoudert at gmail dot com>
- To: gcc at gcc dot gnu dot org, "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>
- Date: Thu, 5 Jul 2007 16:09:53 +0200
- Subject: Help on emitting static constant arrays
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=fOD7OvhM17SIy6Gy9al+klZ2cqzWp3BZdMj8Z2AMEhWROysf0qeebA2NRFmiWpI7y1hj8U3avWjLsBoYjgyQTjpKKgQn+CLPQOKNWcTP2fL4s/x0aSQ4mePWpTIEFHMmva1WrenH82jd3Tq/YBpnKfupb6W6cmOBdiacjzyktSw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=hiOIZVZJkBCk/GCQ2izY1uFteAqbsVqJMK/BLrjQ2a4PylNM51UTnZ0eKxXPf/BQ6sw5fkvHZLBhNv0z8aKxgijhs5ELT9hGO6AEspaZD/3Glheq6+0hDza8g27xMqNet+1R1SJeKeiIUpAAo8vQMnJk/stXoNgkoXhkqDg8M2I=
Hi all,
I'm modifying the Fortran front-end to emit code such as:
static int4 options.2[5] = {102, 127, 1, 1, 1};
_gfortran_set_options (5, options.2);
where _gfortran_set_options is a library function with prototype
"void _gfortran_set_options (int , int [])". This works well (the
pseudo-code snippet above is in fact an extract of the optimized tree
dump), but breaks when used with -O2 -funroll-loops: I get a segfault
due to the function being called with (seen from gdb):
*_gfortran_set_options (num=5, options=0x0)
It's probably a beginner mistake, but I never wrote code to emit
GIMPLE arrays before, and don't know where to look exactly. I'll
continue looking for the reason, but if someone thinks of something
trivial I'd be interested in knowing!
Thanks for the help, and sorry (in advance) if it's a completely
stupid mistake.
FX
Attachment:
try.diff
Description: Binary data