7388 – Incorrect output with 0 based array of characters. (original) (raw)

| Description Toon Moene 2002-07-23 13:36:00 UTC This code: character*256 buff(0:10) character*80 strings(10) integer i,m1,m2 i = 1 m1 = 1 m2 = 7 buff(i) = 'tcase0a' strings(i) = buff(i)(m1:m2) write(*,*)buff(i) write(*,*)buff(i)(m1:m2) write(*,*)strings(i) stop end should print "tcase0a" three times, the first time with 248 blanks attached. However, with 'g77 [other options] -fbounds-check' it doesn't. Release: 3.1 Environment: Linux, probably unimportant Comment 1 Toon Moene 2002-09-28 08:29:06 UTC State-Changed-From-To: open->analyzed State-Changed-Why: Analysed, test case added to g77.dg directory as 7388.f. Might not be a frontend problem, as it doesn't fail on all targets (specifically, sparc64). Comment 3 Toon Moene 2002-10-26 09:01:25 UTC Responsible-Changed-From-To: unassigned->toon Responsible-Changed-Why: Fortran Maintainer. Comment 4 Toon Moene 2002-10-26 09:01:25 UTC State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed in 3.2.1 and 3.3. Probably by Nathan Sidwell, fixing PR c++/7209: * fold_const.c (fold_binary_op_with_conditional_arg): Alwasy build compound_expr if we used save_expr. | | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |