public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/36437] Simplify argument to [c_]sizeof
       [not found] <bug-36437-4@http.gcc.gnu.org/bugzilla/>
@ 2010-12-20 11:02 ` burnus at gcc dot gnu.org
  2010-12-20 11:05 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-12-20 11:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-20 11:02:27 UTC ---
Created attachment 22829
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22829
Draft patch

A different draft patch (I forgot about attachment 15721 - maybe one can move
something over).

This patch implements simplification for c_sizeof/sizeof and for storage_size.

TODO:
- The code (in target-memory.c) currently expects character literal strings or
PARAMETERs and thus fails for character variables
- There needs to be a "return NULL" for characters with only run-time known
length.
- Maybe some other return-early checks?
- Presumably refs of the kind  foo%bar(1)%blub(1:5)(1:2)  are mishandled
- Test cases are missing


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

* [Bug fortran/36437] Simplify argument to [c_]sizeof
       [not found] <bug-36437-4@http.gcc.gnu.org/bugzilla/>
  2010-12-20 11:02 ` [Bug fortran/36437] Simplify argument to [c_]sizeof burnus at gcc dot gnu.org
@ 2010-12-20 11:05 ` burnus at gcc dot gnu.org
  2013-03-27 11:24 ` burnus at gcc dot gnu.org
  2013-03-27 11:29 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-12-20 11:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-20 11:05:36 UTC ---
(Ignore the match.c and resolve.c part - those are for PR PR46371.)


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

* [Bug fortran/36437] Simplify argument to [c_]sizeof
       [not found] <bug-36437-4@http.gcc.gnu.org/bugzilla/>
  2010-12-20 11:02 ` [Bug fortran/36437] Simplify argument to [c_]sizeof burnus at gcc dot gnu.org
  2010-12-20 11:05 ` burnus at gcc dot gnu.org
@ 2013-03-27 11:24 ` burnus at gcc dot gnu.org
  2013-03-27 11:29 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-03-27 11:24 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-03-27 11:24:06 UTC ---
Author: burnus
Date: Wed Mar 27 10:45:58 2013
New Revision: 197159

URL: http://gcc.gnu.org/viewcvs?rev=197159&root=gcc&view=rev
Log:
2013-03-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/56650
        PR fortran/36437
        * check.c (gfc_check_sizeof, gfc_check_c_sizeof,
        gfc_check_storage_size): Update checks.
        * intrinsic.texi (SIZEOF): Correct class.
        * intrinsic.h (gfc_simplify_sizeof,
        gfc_simplify_storage_size): New prototypes.
        * intrinsic.c (add_functions): Use them.
        * simplify.c (gfc_simplify_sizeof,
        gfc_simplify_storage_size): New functions.

2013-03-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/56650
        PR fortran/36437
        * gfortran.dg/sizeof_2.f90: New.
        * gfortran.dg/sizeof_3.f90: New.
        * gfortran.dg/sizeof_proc.f90: Update dg-error.


Added:
    trunk/gcc/testsuite/gfortran.dg/sizeof_2.f90
    trunk/gcc/testsuite/gfortran.dg/sizeof_3.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/check.c
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/fortran/intrinsic.h
    trunk/gcc/fortran/intrinsic.texi
    trunk/gcc/fortran/simplify.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/sizeof_proc.f90


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

* [Bug fortran/36437] Simplify argument to [c_]sizeof
       [not found] <bug-36437-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2013-03-27 11:24 ` burnus at gcc dot gnu.org
@ 2013-03-27 11:29 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-03-27 11:29 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-03-27 11:29:51 UTC ---
FIXED on the 4.9 trunk.

There might be still bugs - especially for the ill-defined vendor extension
SIZEOF, but possibly also for C_SIZEOF and STORAGE_SIZE, but most cases should
be handled correctly (including rejecting arguments like TYPE(*)).


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

* [Bug fortran/36437] Simplify argument to [c_]sizeof
  2008-06-04 20:16 [Bug fortran/36437] New: F2008: Support c_sizeof // " burnus at gcc dot gnu dot org
  2008-06-07 18:58 ` [Bug fortran/36437] " burnus at gcc dot gnu dot org
  2009-03-28 17:15 ` fxcoudert at gcc dot gnu dot org
@ 2010-05-02 15:20 ` dfranke at gcc dot gnu dot org
  2 siblings, 0 replies; 7+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-02 15:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dfranke at gcc dot gnu dot org  2010-05-02 15:20 -------
http://gcc.gnu.org/onlinedocs/gfortran/C_005fSIZEOF.html#C_005fSIZEOF has

Class:
    Intrinsic function 

Sounds strange, "inquiry" seems to be more likely (haven't checked)?!

See also: PR40568.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |39627
              nThis|                            |


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


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

* [Bug fortran/36437] Simplify argument to [c_]sizeof
  2008-06-04 20:16 [Bug fortran/36437] New: F2008: Support c_sizeof // " burnus at gcc dot gnu dot org
  2008-06-07 18:58 ` [Bug fortran/36437] " burnus at gcc dot gnu dot org
@ 2009-03-28 17:15 ` fxcoudert at gcc dot gnu dot org
  2010-05-02 15:20 ` dfranke at gcc dot gnu dot org
  2 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2009-03-28 17:15 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-03-28 17:14:56
               date|                            |


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


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

* [Bug fortran/36437] Simplify argument to [c_]sizeof
  2008-06-04 20:16 [Bug fortran/36437] New: F2008: Support c_sizeof // " burnus at gcc dot gnu dot org
@ 2008-06-07 18:58 ` burnus at gcc dot gnu dot org
  2009-03-28 17:15 ` fxcoudert at gcc dot gnu dot org
  2010-05-02 15:20 ` dfranke at gcc dot gnu dot org
  2 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-06-07 18:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2008-06-07 18:57 -------
F2008's C_SIZEOF is implemented and also the simplification in trans-*.c. The
simplification for arrays in simplify.c is missing; attachment 15721 can be
used as starting point.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|F2008: Support c_sizeof  // |Simplify argument to
                   |Simplify argument to        |[c_]sizeof
                   |[c_]sizeof                  |


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


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

end of thread, other threads:[~2013-03-27 11:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-36437-4@http.gcc.gnu.org/bugzilla/>
2010-12-20 11:02 ` [Bug fortran/36437] Simplify argument to [c_]sizeof burnus at gcc dot gnu.org
2010-12-20 11:05 ` burnus at gcc dot gnu.org
2013-03-27 11:24 ` burnus at gcc dot gnu.org
2013-03-27 11:29 ` burnus at gcc dot gnu.org
2008-06-04 20:16 [Bug fortran/36437] New: F2008: Support c_sizeof // " burnus at gcc dot gnu dot org
2008-06-07 18:58 ` [Bug fortran/36437] " burnus at gcc dot gnu dot org
2009-03-28 17:15 ` fxcoudert at gcc dot gnu dot org
2010-05-02 15:20 ` dfranke at gcc dot gnu dot 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).