Commit 070edbc2 by Janne Blomqvist

PR 40958 Compress module files with zlib.

frontend ChangeLog:

2013-04-17  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/40958
	* scanner.h: New file.
	* Make-lang.in: Dependencies on scanner.h.
	* scanner.c (gfc_directorylist): Move to scanner.h.
	* module.c: Don't include md5.h, include scanner.h and zlib.h.
	(MOD_VERSION): Add comment about backwards compatibility.
	(module_fp): Change type to gzFile.
	(ctx): Remove.
	(gzopen_included_file_1): New function.
	(gzopen_included_file): New function.
	(gzopen_intrinsic_module): New function.
	(write_char): Use gzputc.
	(read_crc32_from_module_file): New function.
	(read_md5_from_module_file): Remove.
	(gfc_dump_module): Use gz* functions instead of stdio, check gzip
	crc32 instead of md5.
	(read_module_to_tmpbuf): Use gz* functions instead of stdio.
	(gfc_use_module): Use gz* functions.

testsuite ChangeLog:

2013-04-17  Janne Blomqvist  <jb@gcc.gnu.org>

        PR fortran/40958
        * lib/gcc-dg.exp (scan-module): Uncompress module file before
        scanning.
        * gfortran.dg/module_md5_1.f90: Remove.

From-SVN: r198023
parent 10a88311
2013-04-17 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/40958
* scanner.h: New file.
* Make-lang.in: Dependencies on scanner.h.
* scanner.c (gfc_directorylist): Move to scanner.h.
* module.c: Don't include md5.h, include scanner.h and zlib.h.
(MOD_VERSION): Add comment about backwards compatibility.
(module_fp): Change type to gzFile.
(ctx): Remove.
(gzopen_included_file_1): New function.
(gzopen_included_file): New function.
(gzopen_intrinsic_module): New function.
(write_char): Use gzputc.
(read_crc32_from_module_file): New function.
(read_md5_from_module_file): Remove.
(gfc_dump_module): Use gz* functions instead of stdio, check gzip
crc32 instead of md5.
(read_module_to_tmpbuf): Use gz* functions instead of stdio.
(gfc_use_module): Use gz* functions.
2013-04-16 Tobias Burnus <burnus@net-b.de>
PR fortran/39505
......
......@@ -369,3 +369,5 @@ fortran/resolve.o: fortran/dependency.h fortran/data.h fortran/target-memory.h
fortran/data.o: fortran/data.h
fortran/options.o: $(PARAMS_H) $(TARGET_H) fortran/cpp.h
fortran/cpp.o: fortran/cpp.c incpath.h incpath.o cppbuiltin.h
fortran/scanner.o: fortran/scanner.h
fortran/module.o: fortran/scanner.h
......@@ -48,18 +48,10 @@ along with GCC; see the file COPYING3. If not see
#include "debug.h"
#include "flags.h"
#include "cpp.h"
/* Structure for holding module and include file search path. */
typedef struct gfc_directorylist
{
char *path;
bool use_for_modules;
struct gfc_directorylist *next;
}
gfc_directorylist;
#include "scanner.h"
/* List of include file search directories. */
static gfc_directorylist *include_dirs, *intrinsic_modules_dirs;
gfc_directorylist *include_dirs, *intrinsic_modules_dirs;
static gfc_file *file_head, *current_file;
......
/* Character scanner header.
Copyright (C) 2013 Free Software Foundation, Inc.
Contributed by Janne Blomqvist
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* Structure for holding module and include file search path. */
typedef struct gfc_directorylist
{
char *path;
bool use_for_modules;
struct gfc_directorylist *next;
}
gfc_directorylist;
/* List of include file search directories. */
extern gfc_directorylist *include_dirs, *intrinsic_modules_dirs;
2013-04-17 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/40958
* lib/gcc-dg.exp (scan-module): Uncompress module file before
scanning.
* gfortran.dg/module_md5_1.f90: Remove.
2013-04-16 Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
* gcc.target/aarch64/adds3.c: New.
......
! Check that we can write a module file, that it has a correct MD5 sum,
! and that we can read it back.
!
! { dg-do compile }
module foo
integer(kind=4), parameter :: pi = 3_4
end module foo
program test
use foo
print *, pi
end program test
! { dg-final { scan-module "foo" "MD5:510304affe70481794fecdb22fc9ca0c" } }
......@@ -633,7 +633,7 @@ proc cleanup-saved-temps { args } {
# Argument 1 is the regexp to match
proc scan-module { args } {
set modfilename [string tolower [lindex $args 0]].mod
set fd [open $modfilename r]
set fd [open [list | gzip -dc $modfilename] r]
set text [read $fd]
close $fd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment