public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
       [not found] <bug-40569-4@http.gcc.gnu.org/bugzilla/>
@ 2010-09-25 15:33 ` burnus at gcc dot gnu.org
  2010-09-26  7:33 ` burnus at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-09-25 15:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-09-25 12:34:38 UTC ---
First part of an implementation.

TODO: (a) Use a module rather than the normal name space. (b) Get the command
line options; cf. http://gcc.gnu.org/ml/gcc-patches/2010-09/msg02006.html

--- intrinsic.c (Revision 164618)
+++ intrinsic.c (Arbeitskopie)
@@ -2613,0 +2615,6 @@ add_functions (void)
+
+/* MOVE TO MODULE: ISO_FORTRAN_ENV.  */
+  add_sym_0 ("compiler_options", GFC_ISYM_COMPILER_VERSION, CLASS_IMPURE,
ACTUAL_NO, BT_CHARACTER,
+            1, GFC_STD_F2008, NULL, gfc_simplify_compiler_options, NULL);
+  add_sym_0 ("compiler_version", GFC_ISYM_COMPILER_VERSION, CLASS_IMPURE,
ACTUAL_NO, BT_CHARACTER,
+            1, GFC_STD_F2008, NULL, gfc_simplify_compiler_version, NULL);
--- simplify.c  (Revision 164618)
+++ simplify.c
@@ -29,2 +29,3 @@ along with GCC; see the file COPYING3.
 #include "constructor.h"
+#include "version.h"  /* For version_string.  */

@@ -6735 +6736,17 @@ gfc_convert_char_constant (gfc_expr *e,
 }
+
+
+gfc_expr *
+gfc_simplify_compiler_options (void)
+{
+  return NULL;
+}
+
+
+gfc_expr *
+gfc_simplify_compiler_version (void)
+{
+  return gfc_get_character_expr (gfc_default_character_kind,
+                                &gfc_current_locus, version_string,
+                                strlen (version_string));
+}

-- 
Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
       [not found] <bug-40569-4@http.gcc.gnu.org/bugzilla/>
  2010-09-25 15:33 ` [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION() burnus at gcc dot gnu.org
@ 2010-09-26  7:33 ` burnus at gcc dot gnu.org
  2010-09-27  9:42 ` burnus at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-09-26  7:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-09-25 22:43:13 UTC ---
Patch: http://gcc.gnu.org/ml/fortran/2010-09/msg00455.html


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

* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
       [not found] <bug-40569-4@http.gcc.gnu.org/bugzilla/>
  2010-09-25 15:33 ` [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION() burnus at gcc dot gnu.org
  2010-09-26  7:33 ` burnus at gcc dot gnu.org
@ 2010-09-27  9:42 ` burnus at gcc dot gnu.org
  2010-09-27 10:25 ` burnus at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-09-27  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-09-26 22:30:52 UTC ---
Author: burnus
Date: Sun Sep 26 22:30:48 2010
New Revision: 164639

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

        PR fortran/40569
        PR fortran/40568
        * intrinsic.h (gfc_simplify_compiler_options,
        gfc_simplify_compiler_version): New prototypes.
        * intrinsic.c (gfc_intrinsic_function_by_id,
        make_from_module): New functions.
        (gfc_find_function, gfc_find_subroutine, gfc_generic_intrinsic,
        gfc_specific_intrinsic): Don't return module intrinsics.
        (add_functions): Add compiler_options, compiler_version.
        (gfc_intrinsic_func_interface): Also lookup symbol by ISYM ID.
        * symbol.c (std_for_isocbinding_symbol): Add version check for
        NAMED_FUNCTIONS.
        * iso-fortran-env.def: Add compiler_options, compiler_version.
        * iso-c-binding.def: Add c_sizeof.
        * gfortran.h (gfc_intrinsic_sym): Add from_module:1.
        (iso_c_binding_symbol, iso_fortran_env_symbol): Add NAMED_FUNCTIONS.
        (gfc_intrinsic_function_by_id): New prototype.
        * module.c (create_intrinsic_function): New function.
        (import_iso_c_binding_module, use_iso_fortran_env_module): Use it.
        * trans-types.c (init_c_interop_kinds): Add NAMED_FUNCTIONS.
        * resolve.c (resolve_intrinsic): Try also to resolve intrinsics
        by ISYM ID.
        * simplify.c (gfc_simplify_compiler_options,
        gfc_simplify_compiler_version): New functions.

2010-09-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/40569
        PR fortran/40568
        * gfortran.dg/storage_size_2.f08: Fix test.
        * gfortran.dg/c_sizeof_1.f90: Fix test.
        * gfortran.dg/c_sizeof_2.f90: Update dg-error.
        * gfortran.dg/c_sizeof_3.f90: New.
        * gfortran.dg/c_sizeof_4.f90: New.
        * gfortran.dg/iso_c_binding_compiler_1.f90: New.
        * gfortran.dg/iso_c_binding_compiler_2.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/c_sizeof_3.f90
    trunk/gcc/testsuite/gfortran.dg/c_sizeof_4.f90
    trunk/gcc/testsuite/gfortran.dg/iso_c_binding_compiler_1.f90
    trunk/gcc/testsuite/gfortran.dg/iso_c_binding_compiler_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/fortran/intrinsic.h
    trunk/gcc/fortran/iso-c-binding.def
    trunk/gcc/fortran/iso-fortran-env.def
    trunk/gcc/fortran/module.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/simplify.c
    trunk/gcc/fortran/symbol.c
    trunk/gcc/fortran/trans-types.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/c_sizeof_1.f90
    trunk/gcc/testsuite/gfortran.dg/c_sizeof_2.f90
    trunk/gcc/testsuite/gfortran.dg/storage_size_2.f08


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

* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
       [not found] <bug-40569-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2010-09-27  9:42 ` burnus at gcc dot gnu.org
@ 2010-09-27 10:25 ` burnus at gcc dot gnu.org
  2010-09-27 10:28 ` burnus at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-09-27 10:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-09-26 22:40:26 UTC ---
Basic implementation works. Remains to do:

(a) COMPILER_OPTIONS(): Return a more useful string than ""

(b) "-Wall" gives a bogus warning:
  Warning: Type specified for intrinsic function 'compiler_version' at (1)
           is ignored
  for
    use iso_fortran_env, only: compiler_version
    print *,compiler_version()
    end


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

* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
       [not found] <bug-40569-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2010-09-27 10:25 ` burnus at gcc dot gnu.org
@ 2010-09-27 10:28 ` burnus at gcc dot gnu.org
  2010-09-27 11:08 ` burnus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-09-27 10:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-09-26 22:46:10 UTC ---
(In reply to comment #6)
> Basic implementation works. Remains to do:
...
(c) CLASS_INQUIRY instead of CLASS_IMPURE?


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

* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
       [not found] <bug-40569-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2010-09-27 10:28 ` burnus at gcc dot gnu.org
@ 2010-09-27 11:08 ` burnus at gcc dot gnu.org
  2010-09-28 14:03 ` Joost.VandeVondele at pci dot uzh.ch
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-09-27 11:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-09-27 06:34:09 UTC ---
(In reply to comment #7)
> (In reply to comment #6)
> > Basic implementation works. Remains to do:
> ...
> (c) CLASS_INQUIRY instead of CLASS_IMPURE?

(d) Documentation in intrinsic.texi


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

* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
       [not found] <bug-40569-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2010-09-27 11:08 ` burnus at gcc dot gnu.org
@ 2010-09-28 14:03 ` Joost.VandeVondele at pci dot uzh.ch
  2010-09-29  2:56 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Joost.VandeVondele at pci dot uzh.ch @ 2010-09-28 14:03 UTC (permalink / raw)
  To: gcc-bugs

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

Joost VandeVondele <Joost.VandeVondele at pci dot uzh.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Joost.VandeVondele at pci
                   |                            |dot uzh.ch

--- Comment #9 from Joost VandeVondele <Joost.VandeVondele at pci dot uzh.ch> 2010-09-28 08:38:52 UTC ---
this is nice... can this be used in an initialization expression ?

MODULE X
 CHARACTER(LEN=100), PARAMETER ::
module_compile_info=compiler_version()//compiler_options()
END MODULE


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

* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
       [not found] <bug-40569-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2010-09-28 14:03 ` Joost.VandeVondele at pci dot uzh.ch
@ 2010-09-29  2:56 ` burnus at gcc dot gnu.org
  2010-09-29  3:33 ` burnus at gcc dot gnu.org
  2010-09-29  7:40 ` burnus at gcc dot gnu.org
  9 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-09-29  2:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-09-28 19:51:42 UTC ---
Author: burnus
Date: Tue Sep 28 19:51:38 2010
New Revision: 164698

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164698
Log:
gcc/
2010-09-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/40569
        PR fortran/40568
        * toplev.h (save_decoded_options, save_decoded_options_count):
        New global variables.
        * toplev.c (save_decoded_options, save_decoded_options_count):
        export variables.

gcc/fortran/
2010-09-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/40569
        PR fortran/40568
        * intrinsic.c (add_functions): Make compiler_version and
        compiler_options CLASS_INQUIRY.
        * gfortran.h (gfc_get_option_string): New prototype.
        * intrinsic.texi (COMPILER_VERSION, COMPILER_OPTIONS):
        Add documentation.
        (C_SIZEOF): Mark as inquiry function of ISO_C_BINDING.
        (ISO_FORTRAN_ENV): Refer to COMPILER_VERSION and COMPILER_OPTIONS.
        (ISO_C_BINDING): Refer to C_SIZEOF.
        * options.c (gfc_get_option_string): New function.
        * simplify.c (gfc_simplify_compiler_options): Use it.
        (gfc_simplify_compiler_version): Include compiler name.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/fortran/intrinsic.texi
    trunk/gcc/fortran/options.c
    trunk/gcc/fortran/simplify.c
    trunk/gcc/toplev.c
    trunk/gcc/toplev.h


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

* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
       [not found] <bug-40569-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2010-09-29  2:56 ` burnus at gcc dot gnu.org
@ 2010-09-29  3:33 ` burnus at gcc dot gnu.org
  2010-09-29  7:40 ` burnus at gcc dot gnu.org
  9 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-09-29  3:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-09-28 19:52:55 UTC ---
Close as FIXED (for 4.6).


Separately tracked follow ups:

For updating check_inquiry, cf. PR 45824.

For the bogus warning, cf. PR 45823



(In reply to comment #9)
> this is nice... can this be used in an initialization expression ?
>
>  CHARACTER(LEN=100), PARAMETER :: module_compile_info = & 
>         compiler_version()//compiler_options()

Yes, but you need to add "use iso_fortran_env".


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

* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
       [not found] <bug-40569-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2010-09-29  3:33 ` burnus at gcc dot gnu.org
@ 2010-09-29  7:40 ` burnus at gcc dot gnu.org
  9 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-09-29  7:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #12 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-09-28 19:55:51 UTC ---
Really mark as FIXED.


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

* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
  2009-06-27 16:16 [Bug fortran/40569] New: " burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-07-05  9:16 ` fxcoudert at gcc dot gnu dot org
@ 2010-06-23 16:46 ` burnus at gcc dot gnu dot org
  3 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-06-23 16:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2010-06-23 16:46 -------
Cf. PR 40568 for "C_SIZEOF", a F2008 module procedure of ISO_C_BINDING


-- 


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


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

* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
  2009-06-27 16:16 [Bug fortran/40569] New: " burnus at gcc dot gnu dot org
  2009-06-27 19:44 ` [Bug fortran/40569] " burnus at gcc dot gnu dot org
  2009-07-05  9:16 ` fxcoudert at gcc dot gnu dot org
@ 2009-07-05  9:16 ` fxcoudert at gcc dot gnu dot org
  2010-06-23 16:46 ` burnus at gcc dot gnu dot org
  3 siblings, 0 replies; 14+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2009-07-05  9:16 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |39627
              nThis|                            |
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-07-05 09:15:48
               date|                            |


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


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

* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
  2009-06-27 16:16 [Bug fortran/40569] New: " burnus at gcc dot gnu dot org
  2009-06-27 19:44 ` [Bug fortran/40569] " burnus at gcc dot gnu dot org
@ 2009-07-05  9:16 ` fxcoudert at gcc dot gnu dot org
  2009-07-05  9:16 ` fxcoudert at gcc dot gnu dot org
  2010-06-23 16:46 ` burnus at gcc dot gnu dot org
  3 siblings, 0 replies; 14+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2009-07-05  9:16 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


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


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

* [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION()
  2009-06-27 16:16 [Bug fortran/40569] New: " burnus at gcc dot gnu dot org
@ 2009-06-27 19:44 ` burnus at gcc dot gnu dot org
  2009-07-05  9:16 ` fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-06-27 19:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2009-06-27 19:44 -------
Do not forget to update intrinsic.texi!

For the missing constants in ISO_FORTRAN_ENV, see PR 40571


-- 


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


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

end of thread, other threads:[~2010-09-28 19:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-40569-4@http.gcc.gnu.org/bugzilla/>
2010-09-25 15:33 ` [Bug fortran/40569] F2008: Support COMPILER_OPTIONS() / COMPILER_VERSION() burnus at gcc dot gnu.org
2010-09-26  7:33 ` burnus at gcc dot gnu.org
2010-09-27  9:42 ` burnus at gcc dot gnu.org
2010-09-27 10:25 ` burnus at gcc dot gnu.org
2010-09-27 10:28 ` burnus at gcc dot gnu.org
2010-09-27 11:08 ` burnus at gcc dot gnu.org
2010-09-28 14:03 ` Joost.VandeVondele at pci dot uzh.ch
2010-09-29  2:56 ` burnus at gcc dot gnu.org
2010-09-29  3:33 ` burnus at gcc dot gnu.org
2010-09-29  7:40 ` burnus at gcc dot gnu.org
2009-06-27 16:16 [Bug fortran/40569] New: " burnus at gcc dot gnu dot org
2009-06-27 19:44 ` [Bug fortran/40569] " burnus at gcc dot gnu dot org
2009-07-05  9:16 ` fxcoudert at gcc dot gnu dot org
2009-07-05  9:16 ` fxcoudert at gcc dot gnu dot org
2010-06-23 16:46 ` burnus 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).