public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug fortran/36437] New: F2008: Support c_sizeof // Simplify argument to [c_]sizeof @ 2008-06-04 20:16 burnus at gcc dot gnu dot org 2008-06-04 20:20 ` [Bug fortran/36437] " burnus at gcc dot gnu dot org ` (5 more replies) 0 siblings, 6 replies; 11+ messages in thread From: burnus at gcc dot gnu dot org @ 2008-06-04 20:16 UTC (permalink / raw) To: gcc-bugs -- Summary: F2008: Support c_sizeof // Simplify argument to [c_]sizeof Product: gcc Version: 4.4.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36437 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/36437] F2008: Support c_sizeof // Simplify argument to [c_]sizeof 2008-06-04 20:16 [Bug fortran/36437] New: F2008: Support c_sizeof // Simplify argument to [c_]sizeof burnus at gcc dot gnu dot org @ 2008-06-04 20:20 ` burnus at gcc dot gnu dot org 2008-06-04 20:22 ` burnus at gcc dot gnu dot org ` (4 subsequent siblings) 5 siblings, 0 replies; 11+ messages in thread From: burnus at gcc dot gnu dot org @ 2008-06-04 20:20 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from burnus at gcc dot gnu dot org 2008-06-04 20:19 ------- Created an attachment (id=15720) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15720&action=view) Incomplete patch Fortran 2008 supports c_sizeof which is identical to gfortran's sizeof. This patch does the following: - Implements c_sizeof (one line in intrinsic.c) - Fixes argument (sizeof(x) not sizeof(i)) - intrinsic.c - Document new option - intrinsic.texi - trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Don't create { integer(kind=8) bytes.1; i = 4; } in the simple case but simply "i = 4". - simplify.c: Add gfc_simplify_sizeof: This partially works, is currently quite hacky and fails for substrings. TODO: Fix the last item. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36437 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/36437] F2008: Support c_sizeof // Simplify argument to [c_]sizeof 2008-06-04 20:16 [Bug fortran/36437] New: F2008: Support c_sizeof // Simplify argument to [c_]sizeof burnus at gcc dot gnu dot org 2008-06-04 20:20 ` [Bug fortran/36437] " burnus at gcc dot gnu dot org @ 2008-06-04 20:22 ` burnus at gcc dot gnu dot org 2008-06-07 18:54 ` burnus at gcc dot gnu dot org ` (3 subsequent siblings) 5 siblings, 0 replies; 11+ messages in thread From: burnus at gcc dot gnu dot org @ 2008-06-04 20:22 UTC (permalink / raw) To: gcc-bugs ------- Comment #2 from burnus at gcc dot gnu dot org 2008-06-04 20:21 ------- Created an attachment (id=15721) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15721&action=view) The real incomplete patch Previous patch was an older version of this patch. -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #15720|0 |1 is obsolete| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36437 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/36437] F2008: Support c_sizeof // Simplify argument to [c_]sizeof 2008-06-04 20:16 [Bug fortran/36437] New: F2008: Support c_sizeof // Simplify argument to [c_]sizeof burnus at gcc dot gnu dot org 2008-06-04 20:20 ` [Bug fortran/36437] " burnus at gcc dot gnu dot org 2008-06-04 20:22 ` burnus at gcc dot gnu dot org @ 2008-06-07 18:54 ` burnus at gcc dot gnu dot org 2008-06-07 18:58 ` [Bug fortran/36437] " burnus at gcc dot gnu dot org ` (2 subsequent siblings) 5 siblings, 0 replies; 11+ messages in thread From: burnus at gcc dot gnu dot org @ 2008-06-07 18:54 UTC (permalink / raw) To: gcc-bugs ------- Comment #3 from burnus at gcc dot gnu dot org 2008-06-07 18:53 ------- Subject: Bug 36437 Author: burnus Date: Sat Jun 7 18:53:07 2008 New Revision: 136536 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136536 Log: 2008-06-04 Tobias Burnus <burnus@net-b.de> PR fortran/36437 * intrinsic.c (add_functions): Implement c_sizeof. * trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Do not create unneeded variable in the scalar case. 2008-06-04 Tobias Burnus <burnus@net-b.de> PR fortran/36437 * gfortran.dg/c_sizeof_1.f90: New. * gfortran.dg/c_sizeof_2.f90: New. Added: trunk/gcc/testsuite/gfortran.dg/c_sizeof_1.f90 trunk/gcc/testsuite/gfortran.dg/c_sizeof_2.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/intrinsic.c trunk/gcc/fortran/intrinsic.texi trunk/gcc/fortran/trans-intrinsic.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36437 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/36437] Simplify argument to [c_]sizeof 2008-06-04 20:16 [Bug fortran/36437] New: F2008: Support c_sizeof // Simplify argument to [c_]sizeof burnus at gcc dot gnu dot org ` (2 preceding siblings ...) 2008-06-07 18:54 ` 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 5 siblings, 0 replies; 11+ 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] 11+ messages in thread
* [Bug fortran/36437] Simplify argument to [c_]sizeof 2008-06-04 20:16 [Bug fortran/36437] New: F2008: Support c_sizeof // Simplify argument to [c_]sizeof burnus at gcc dot gnu dot org ` (3 preceding siblings ...) 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 5 siblings, 0 replies; 11+ 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] 11+ messages in thread
* [Bug fortran/36437] Simplify argument to [c_]sizeof 2008-06-04 20:16 [Bug fortran/36437] New: F2008: Support c_sizeof // Simplify argument to [c_]sizeof burnus at gcc dot gnu dot org ` (4 preceding siblings ...) 2009-03-28 17:15 ` fxcoudert at gcc dot gnu dot org @ 2010-05-02 15:20 ` dfranke at gcc dot gnu dot org 5 siblings, 0 replies; 11+ 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] 11+ messages in thread
[parent not found: <bug-36437-4@http.gcc.gnu.org/bugzilla/>]
* [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; 11+ 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] 11+ 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 ` 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; 11+ 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] 11+ 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 ` 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; 11+ 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] 11+ 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; 11+ 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] 11+ messages in thread
end of thread, other threads:[~2013-03-27 11:29 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-06-04 20:16 [Bug fortran/36437] New: F2008: Support c_sizeof // Simplify argument to [c_]sizeof burnus at gcc dot gnu dot org 2008-06-04 20:20 ` [Bug fortran/36437] " burnus at gcc dot gnu dot org 2008-06-04 20:22 ` burnus at gcc dot gnu dot org 2008-06-07 18:54 ` 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 [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 2013-03-27 11:24 ` burnus at gcc dot gnu.org 2013-03-27 11:29 ` burnus 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).