Janus Weil wrote:
here is a close-to-obvious patch which should fix the occasional failures of class_optional_2.f90 in the testsuite.
Thanks!
On second thought, I decided to move this check inside of internal_pack. While this can potentially decrease performance (due to the additional function call, which I hope is negligible), it ensures that this check is really done in all possible situations, which makes internal_pack somewhat safer.
I think the performance degradation is low - especially as the code-gen version has also a performance penalty, unless the compiler is able to deduce at compile time that the flag can be optimized away.
The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk?
Okay.
Btw, should I include the additional test case when committing, or is it sufficient to have class_optional_2.f90?
I haven't really followed when the failure occurs. If the new test makes failures more likely than with class_optional_2.f90, I'd include it. Otherwise, I'd guess it is not necessary. Similarly for my test case in PR fortran/55978 comment 19 - I don't know whether it is covered anywhere. If not, you could put Thomas' and my test case into one file and include it.
Tobias
2013-02-06 Janus Weil <ja...@gcc.gnu.org> PR fortran/55978 * runtime/in_pack_generic.c (internal_pack): Return if base_addr is NULL. 2013-02-06 Janus Weil <ja...@gcc.gnu.org> PR fortran/55978 * gfortran.dg/optional_absent_3.f90: New.