public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49011] New: Wrong repeat count in error message for REPEAT intrinsic
@ 2011-05-16  9:08 thenlich at users dot sourceforge.net
  2011-05-16  9:32 ` [Bug fortran/49011] " dominiq at lps dot ens.fr
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: thenlich at users dot sourceforge.net @ 2011-05-16  9:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49011

           Summary: Wrong repeat count in error message for REPEAT
                    intrinsic
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: thenlich@users.sourceforge.net


If the REPEAT intrinsic is given a negative NCOPIES argument at runtime, in the
resulting error message an erraneous value is printed.

Example:
program test_repeat
    integer :: i = -1
    print *, repeat("x", i)
end program test_repeat

$ ./a.out
At line 3 of file test_repeat.f90
Fortran runtime error: Argument NCOPIES of REPEAT intrinsic is negative (its
value is 4294967295)

Expected result:
At line 3 of file test_repeat.f90
Fortran runtime error: Argument NCOPIES of REPEAT intrinsic is negative (its
value is -1)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/49011] Wrong repeat count in error message for REPEAT intrinsic
  2011-05-16  9:08 [Bug fortran/49011] New: Wrong repeat count in error message for REPEAT intrinsic thenlich at users dot sourceforge.net
@ 2011-05-16  9:32 ` dominiq at lps dot ens.fr
  2011-05-16 11:13 ` burnus at gcc dot gnu.org
  2012-02-03 22:31 ` bdavis at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-05-16  9:32 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49011

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.05.16 09:22:14
     Ever Confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-05-16 09:22:14 UTC ---
On x86_64-apple-darwin10, the test returns

Fortran runtime error: Argument NCOPIES of REPEAT intrinsic is negative (its
value is -1)

with -m64 (default). The value returned with -m32 depends on the version:
72057598332895231 for 4.4.4 and 4.5.2, 118064355999743 for 4.6.0 (r169227), and
4294967295 for trunk (r173786).


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/49011] Wrong repeat count in error message for REPEAT intrinsic
  2011-05-16  9:08 [Bug fortran/49011] New: Wrong repeat count in error message for REPEAT intrinsic thenlich at users dot sourceforge.net
  2011-05-16  9:32 ` [Bug fortran/49011] " dominiq at lps dot ens.fr
@ 2011-05-16 11:13 ` burnus at gcc dot gnu.org
  2012-02-03 22:31 ` bdavis at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-05-16 11:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49011

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-05-16 10:15:03 UTC ---
With -m64:

_gfortran_runtime_error_at (&"At line 3 of file foo.f90"[1]{lb: 1 sz: 1},
&"Argument NCOPIES of REPEAT intrinsic is negative (its value is %lld)"[1]{lb:
1 sz: 1}, (integer(kind=8)) D.1547);

With -m32:

_gfortran_runtime_error_at (&"At line 3 of file foo.f90"[1]{lb: 1 sz: 1},
&"Argument NCOPIES of REPEAT intrinsic is negative (its value is %lld)"[1]{lb:
1 sz: 1}, (<unnamed-signed:32>) D.1501);


Thus, in both cases the argument value is wrongly cast; cf. POSIX's printf(3):

       ll (ell-ell)
              Specifies  that  a  following d , i , o , u , x , or X
              conversion  specifier  applies  to  a  long  long   or
              unsigned  long  long  argument;  or that a following n
              conversion specifier applies to a pointer  to  a  long
              long argument.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/49011] Wrong repeat count in error message for REPEAT intrinsic
  2011-05-16  9:08 [Bug fortran/49011] New: Wrong repeat count in error message for REPEAT intrinsic thenlich at users dot sourceforge.net
  2011-05-16  9:32 ` [Bug fortran/49011] " dominiq at lps dot ens.fr
  2011-05-16 11:13 ` burnus at gcc dot gnu.org
@ 2012-02-03 22:31 ` bdavis at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: bdavis at gcc dot gnu.org @ 2012-02-03 22:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49011

Bud Davis <bdavis at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bdavis at gcc dot gnu.org

--- Comment #3 from Bud Davis <bdavis at gcc dot gnu.org> 2012-02-03 22:31:23 UTC ---
32 bit, 2.6 kernel,  revision 183881, message is correct.
Should this be closed or is it an X86-64 thing ?

--bud davis


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-03 22:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-16  9:08 [Bug fortran/49011] New: Wrong repeat count in error message for REPEAT intrinsic thenlich at users dot sourceforge.net
2011-05-16  9:32 ` [Bug fortran/49011] " dominiq at lps dot ens.fr
2011-05-16 11:13 ` burnus at gcc dot gnu.org
2012-02-03 22:31 ` bdavis at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).