]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
4 months agogccrs: Change lookup_hir_struct_field return type
Pierre-Emmanuel Patry [Fri, 3 May 2024 18:48:10 +0000 (20:48 +0200)] 
gccrs: Change lookup_hir_struct_field return type

Wrap the function's return type within an optional to differentiate
between a null pointer and a missing value.

gcc/rust/ChangeLog:

* util/rust-hir-map.cc (Mappings::insert_hir_struct_field): Change
call site to accomodate new return type.
(Mappings::lookup_hir_struct_field): Change the function's return
type.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change lookup_hir_self_param return type
Pierre-Emmanuel Patry [Fri, 3 May 2024 18:42:06 +0000 (20:42 +0200)] 
gccrs: Change lookup_hir_self_param return type

Wrap the function's return type within an optional in order to
differentiate null pointers from missing value.

gcc/rust/ChangeLog:

* util/rust-hir-map.cc (Mappings::insert_hir_self_param): Adapt call
site to new return type.
(Mappings::lookup_hir_self_param): Change the function's return type.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change lookup_hir_param return type with optional
Pierre-Emmanuel Patry [Fri, 3 May 2024 18:34:58 +0000 (20:34 +0200)] 
gccrs: Change lookup_hir_param return type with optional

Wrap the function's return type within an optional to differentiate
between a null ppointer and a missing value.

gcc/rust/ChangeLog:

* util/rust-hir-map.cc (Mappings::insert_hir_param): Change call site
to accomodate new return type.
(Mappings::lookup_hir_param): Change the function's return type.
* util/rust-hir-map.h: Updat ethe function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change lookup_hir_smt's return type with optional
Pierre-Emmanuel Patry [Fri, 3 May 2024 18:17:16 +0000 (20:17 +0200)] 
gccrs: Change lookup_hir_smt's return type with optional

Wrap the function's return type within an optional in order to
differentiate missing values from null pointers.

gcc/rust/ChangeLog:

* util/rust-hir-map.cc (Mappings::insert_hir_stmt): Change call site
to accomodate new return type.
(Mappings::lookup_hir_stmt): Change the function's return type.
(Mappings::resolve_nodeid_to_stmt): Adapt call site to new return type.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change lookup_hir_type return type with an optional
Pierre-Emmanuel Patry [Fri, 3 May 2024 18:08:14 +0000 (20:08 +0200)] 
gccrs: Change lookup_hir_type return type with an optional

Wrap the function's return type with an optional in order to tell
appart a null pointer from a missing value.

gcc/rust/ChangeLog:

* util/rust-hir-map.cc (Mappings::insert_hir_type): Change call site
to accomodate the new return type.
(Mappings::lookup_hir_type): Change the function's return type.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change lookup_hir_generic_param return type
Pierre-Emmanuel Patry [Fri, 3 May 2024 17:59:43 +0000 (19:59 +0200)] 
gccrs: Change lookup_hir_generic_param return type

Wrap the function's return type with an optional.

gcc/rust/ChangeLog:

* util/rust-hir-map.cc (Mappings::insert_hir_generic_param): Change
call site to accomodate the new return type.
(Mappings::lookup_hir_generic_param): Wrap the function's return type
with an optional.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change lookup_hir_path_expr_seg return type
Pierre-Emmanuel Patry [Fri, 3 May 2024 17:49:44 +0000 (19:49 +0200)] 
gccrs: Change lookup_hir_path_expr_seg return type

Make the function's return type optional in order to differentiate
between null pointers and missing value.

gcc/rust/ChangeLog:

* util/rust-hir-map.cc (Mappings::insert_hir_path_expr_seg): Change
call site to accomodate the new return type.
(Mappings::lookup_hir_path_expr_seg): Wrap the function's return type
with an optional.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change lookup_hir_expr return type to optional
Pierre-Emmanuel Patry [Fri, 3 May 2024 17:40:18 +0000 (19:40 +0200)] 
gccrs: Change lookup_hir_expr return type to optional

Wrap the function's return type with an optional in order to
differentiate missing values from null pointers.

gcc/rust/ChangeLog:

* backend/rust-mangle-v0.cc (v0_path): Adapt call site to new returned
type.
* util/rust-hir-map.cc (Mappings::lookup_hir_expr): Change the
function's return type.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change lookup_hir_implitem return type
Pierre-Emmanuel Patry [Fri, 3 May 2024 14:30:06 +0000 (16:30 +0200)] 
gccrs: Change lookup_hir_implitem return type

Wrap the return type within an optional. Now return the parent id within
a pair instead of taking an out reference.

gcc/rust/ChangeLog:

* backend/rust-compile-item.cc (CompileItem::visit): Change call site
to accept new return type.
* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
Likewise.
* backend/rust-mangle-v0.cc (v0_path): Likewise.
* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit):
Likewise.
* checks/lints/rust-lint-marklive.cc (MarkLive::go): Likewise.
(MarkLive::visit): Likewise.
* typecheck/rust-type-util.cc (query_type): Likewise.
* util/rust-hir-map.cc (Mappings::insert_hir_implitem): Likewise.
(Mappings::lookup_hir_implitem): Change return type.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change return type to optional in get_lang_item
Pierre-Emmanuel Patry [Fri, 3 May 2024 12:54:06 +0000 (14:54 +0200)] 
gccrs: Change return type to optional in get_lang_item

Wrap the function's return type with an optional.

gcc/rust/ChangeLog:

* typecheck/rust-autoderef.cc: Adapt calling code to new return type.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
Likewise.
(TypeCheckExpr::resolve_operator_overload): Likewise.
* typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_builtin_candidate):
Likewise.
* typecheck/rust-tyty.cc (ClosureType::setup_fn_once_output): Likewise.
* util/rust-hir-map.cc (Mappings::get_lang_item): Change return type.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change lookup_module function return type
Pierre-Emmanuel Patry [Fri, 3 May 2024 11:25:20 +0000 (13:25 +0200)] 
gccrs: Change lookup_module function return type

Wrap the return type into an optional.

gcc/rust/ChangeLog:

* checks/errors/privacy/rust-visibility-resolver.cc: Update function
call to match the new return type.
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
Likewise.
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
Likewise.
* util/rust-hir-map.cc (Mappings::insert_module): Likewise.
(Mappings::lookup_module): Change the function's return type.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change lookup_hir_extern_item return type
Pierre-Emmanuel Patry [Thu, 2 May 2024 11:44:10 +0000 (13:44 +0200)] 
gccrs: Change lookup_hir_extern_item return type

Wrap the return type with an optional and make the return type a pair
with the parent hid.

gcc/rust/ChangeLog:

* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
Adapt code around new return type.
* checks/errors/rust-const-checker.cc (ConstChecker::check_function_call):
Likewise.
* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::check_use_of_static):
Likewise.
(UnsafeChecker::check_function_call): Likewise.
* typecheck/rust-type-util.cc (query_type): Likewise.
* util/rust-hir-map.cc (Mappings::insert_hir_extern_item): Likewise.
(Mappings::lookup_hir_extern_item): Change return type.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change return type of lookup trait defid functions.
Pierre-Emmanuel Patry [Thu, 2 May 2024 10:33:20 +0000 (12:33 +0200)] 
gccrs: Change return type of lookup trait defid functions.

Wrap the return type with an optional.

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
Update code around lookup return type.
* typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound):
Likewise.
* typecheck/rust-tyty.cc (ClosureType::setup_fn_once_output):
Likewise.
* util/rust-hir-map.cc (Mappings::insert_defid_mapping): Likewise.
(Mappings::lookup_trait_item_defid): Update return type with an
optional.
(Mappings::get_lang_item): Likewise.
* util/rust-hir-map.h: Update the functions prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change lookup_local_defid return type to optional
Pierre-Emmanuel Patry [Thu, 2 May 2024 09:43:02 +0000 (11:43 +0200)] 
gccrs: Change lookup_local_defid return type to optional

Make the API more convenient by changing the function's return type. We
can now differentiate between a stored null pointer and a missing value.

gcc/rust/ChangeLog:

* util/rust-hir-map.cc (Mappings::insert_defid_mapping): Adapt call
to new return type.
(Mappings::insert_local_defid_mapping): Likewise.
(Mappings::lookup_local_defid): Change return type to wrap it with an
optional.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change return type of lookup_defid
Pierre-Emmanuel Patry [Fri, 26 Apr 2024 10:02:53 +0000 (12:02 +0200)] 
gccrs: Change return type of lookup_defid

Change the return type to an optional.

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
Change calling code to accomodate new return type.
* checks/errors/privacy/rust-privacy-reporter.cc:
Likewise.
* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::get_marker_predicate):
Likewise.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
Likewise.
* typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_builtin_candidate):
Likewise.
* typecheck/rust-tyty.cc (ClosureType::setup_fn_once_output): Likewise.
* util/rust-hir-map.cc (Mappings::lookup_defid): Change function's
return type.
* util/rust-hir-map.h: Update function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change crate name retrieval function return types
Pierre-Emmanuel Patry [Thu, 25 Apr 2024 14:34:44 +0000 (16:34 +0200)] 
gccrs: Change crate name retrieval function return types

Change their return type to a const reference in order to avoid copies
when possible. Also wrap this new return type into an optional.

gcc/rust/ChangeLog:

* checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
Adapt the code to the new return types.
* resolve/rust-ast-resolve.cc (NameResolution::go): Likewise.
* util/rust-hir-map.cc (Mappings::get_crate_name): Change return type
to const string reference optional.
(Mappings::get_current_crate_name): Likewise.
* util/rust-hir-map.h: Update function prototypes.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change crate_num_to_nodeid return type
Pierre-Emmanuel Patry [Thu, 25 Apr 2024 14:15:42 +0000 (16:15 +0200)] 
gccrs: Change crate_num_to_nodeid return type

Change the function's return type to an optional.

gcc/rust/ChangeLog:

* resolve/rust-ast-resolve-toplevel.h: Adapt the code to the new
return type.
* rust-session-manager.cc (Session::load_extern_crate): Likewise.
* util/rust-hir-map.cc (Mappings::crate_num_to_nodeid): Change the
return type.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change return type of lookup_crate_name
Pierre-Emmanuel Patry [Thu, 25 Apr 2024 14:00:23 +0000 (16:00 +0200)] 
gccrs: Change return type of lookup_crate_name

Change the function's return type to use an optional.

gcc/rust/ChangeLog:

* resolve/rust-ast-resolve-toplevel.h: Adapt the code to the new
return type.
* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
Likewise.
* rust-session-manager.cc (Session::load_extern_crate): Likewise.
* util/rust-hir-map.cc (Mappings::lookup_crate_name): Change the return
type to an optional.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change return type of lookup_impl_block_type
Pierre-Emmanuel Patry [Thu, 25 Apr 2024 13:39:33 +0000 (15:39 +0200)] 
gccrs: Change return type of lookup_impl_block_type

Change the return type to an optional.

gcc/rust/ChangeLog:

* typecheck/rust-type-util.cc (query_type): Adapt code to accomodate
the new return type.
* util/rust-hir-map.cc (Mappings::lookup_impl_block_type): Change
the function's return type and remove the out pointer argument.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change return type for lookup_hir_impl_block
Pierre-Emmanuel Patry [Thu, 25 Apr 2024 13:28:32 +0000 (15:28 +0200)] 
gccrs: Change return type for lookup_hir_impl_block

Change the return type to an optiona. This allows to differentiate
between missing hir impl block and null pointers.

gcc/rust/ChangeLog:

* typecheck/rust-type-util.cc (query_type): Change call to the function
in order to accomodate the new return type.
* util/rust-hir-map.cc (Mappings::lookup_hir_impl_block): Change the
function's return type to an optional.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change return type of lookup_hir_extern_block
Pierre-Emmanuel Patry [Thu, 25 Apr 2024 13:14:36 +0000 (15:14 +0200)] 
gccrs: Change return type of lookup_hir_extern_block

Change the return type to an optional in order to easily differentiate
between a null pointer and an missing value.

gcc/rust/ChangeLog:

* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::check_function_call):
Adapt function call to new return type.
* typecheck/rust-type-util.cc (query_type): Likewise.
* util/rust-hir-map.cc (Mappings::insert_hir_extern_block): Likewise.
(Mappings::lookup_hir_extern_block): Change return type to an optional.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change return type of lookup_hir_trait_item
Pierre-Emmanuel Patry [Thu, 25 Apr 2024 12:54:23 +0000 (14:54 +0200)] 
gccrs: Change return type of lookup_hir_trait_item

Change the return type to an optional instead of returning a null
pointer. This allows easier tracking of rogue null pointers in the
map. This commit also fixes a bug in trait associated function mangling,
the function was using an already invalidated pointer.

gcc/rust/ChangeLog:

* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
Adapt return type to new optional.
* backend/rust-mangle-v0.cc (v0_function_path): Change prototype to use
the generic arguments vector instead of the whole HIR function.
(v0_path): Fix a bug with a null pointer being used to create the
trait function mangling.
* util/rust-hir-map.cc (Mappings::insert_hir_trait_item): Adapt code
to new return type.
(Mappings::lookup_hir_trait_item): Change the return type of the
function to an optional.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change return type for lookup_hir_item to optional
Pierre-Emmanuel Patry [Thu, 25 Apr 2024 08:48:47 +0000 (10:48 +0200)] 
gccrs: Change return type for lookup_hir_item to optional

gcc/rust/ChangeLog:

* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
Adapt function call to new return type.
* backend/rust-mangle-v0.cc (v0_path): Likewise.
* checks/errors/rust-const-checker.cc (ConstChecker::check_function_call):
Likewise.
* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::check_use_of_static):
Likewise.
(UnsafeChecker::check_function_call): Likewise.
(UnsafeChecker::check_function_attr): Likewise.
* checks/lints/rust-lint-marklive.cc (MarkLive::go): Likewise.
(MarkLive::visit): Likewise.
* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait):
Likewise.
* typecheck/rust-type-util.cc (query_type): Likewise.
* util/rust-hir-map.cc (Mappings::insert_hir_item): Likewise.
(Mappings::lookup_hir_item): Change function return type to use
optional.
* util/rust-hir-map.h: Update function prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change return type of resolve_nodeid_to_stmt
Pierre-Emmanuel Patry [Wed, 24 Apr 2024 21:21:57 +0000 (23:21 +0200)] 
gccrs: Change return type of resolve_nodeid_to_stmt

Change the return type to an optional.

gcc/rust/ChangeLog:

* util/rust-hir-map.cc (Mappings::resolve_nodeid_to_stmt): Change the
return type and remove pointer out argument.
* util/rust-hir-map.h: Update function prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change lookup_hir_to_node return type to optional
Pierre-Emmanuel Patry [Wed, 24 Apr 2024 20:32:54 +0000 (22:32 +0200)] 
gccrs: Change lookup_hir_to_node return type to optional

Optional are more convenient to use and avoid uninitialized data.

gcc/rust/ChangeLog:

* backend/rust-compile-expr.cc (CompileExpr::generate_closure_function):
Adapt code for new optional return type.
* checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::check_base_type_privacy):
Likewise.
* util/rust-hir-map.cc (Mappings::lookup_hir_to_node): Change return
type to an optional.
* util/rust-hir-map.h: Adapt function prototype with the new return
type.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Change lookup_node_to_hir return type to optional
Pierre-Emmanuel Patry [Wed, 24 Apr 2024 19:27:26 +0000 (21:27 +0200)] 
gccrs: Change lookup_node_to_hir return type to optional

Previous API was using a boolean and a pointer, this was not practical
and could be replaced with an optional.

gcc/rust/ChangeLog:

* backend/rust-compile-expr.cc (CompileExpr::visit): Change call to use
the returned optional.
(CompileExpr::generate_closure_function): Likewise.
* backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve):
Likewise.
* backend/rust-compile-type.cc (TyTyResolveCompile::visit): Likewise.
* backend/rust-mangle-v0.cc (v0_path): Likewise.
* checks/errors/privacy/rust-visibility-resolver.cc:
Likewise.
* checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit):
Likewise.
* checks/lints/rust-lint-marklive.cc (MarkLive::visit): Likewise.
(MarkLive::visit_path_segment): Likewise.
* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait):
Likewise.
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
Likewise.
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
Likewise.
(ResolveWhereClauseItem::visit): Likewise.
* util/rust-hir-map.cc (Mappings::lookup_node_to_hir): Return an
optional instead of a boolean.
* util/rust-hir-map.h: Change function prototype to match the new
return type.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Visit constant items without expressions properly
Owen Avery [Thu, 29 Feb 2024 01:19:04 +0000 (20:19 -0500)] 
gccrs: Visit constant items without expressions properly

gcc/rust/ChangeLog:

* resolve/rust-default-resolver.cc
(DefaultResolver::visit):
Verify constant item has expression before attempting to visit
the later.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
4 months agogccrs: Improve matching on non-enum ADTs
Owen Avery [Fri, 3 May 2024 00:58:49 +0000 (20:58 -0400)] 
gccrs: Improve matching on non-enum ADTs

gcc/rust/ChangeLog:

* backend/rust-compile-expr.cc
(check_match_scrutinee): Add assertion.
* backend/rust-compile-pattern.cc
(CompilePatternCheckExpr::visit):
Handle HIR::PathInExpression matching a non-enum.

gcc/testsuite/ChangeLog:

* rust/compile/match-struct-path.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
4 months agogccrs: Add testcases for handling struct as scrutinee for match expr
Nobel Singh [Tue, 23 Apr 2024 20:22:52 +0000 (02:07 +0545)] 
gccrs: Add testcases for handling struct as scrutinee for match expr

gcc/testsuite/ChangeLog:

* rust/compile/issue-2906.rs: New test.
* rust/execute/torture/issue-2906.rs: New test.

Signed-off-by: Nobel Singh <nobel2073@gmail.com>
4 months agogccrs: Handle structs as scrutinee for match expressions
Nobel Singh [Sun, 21 Apr 2024 18:41:12 +0000 (00:26 +0545)] 
gccrs: Handle structs as scrutinee for match expressions

gcc/rust/ChangeLog:

* backend/rust-compile-expr.cc (check_match_scrutinee): Handle structs

Signed-off-by: Nobel Singh <nobel2073@gmail.com>
4 months agogccrs: Remove unused Context parameter for some backend methods
Owen Avery [Thu, 25 Apr 2024 16:19:51 +0000 (12:19 -0400)] 
gccrs: Remove unused Context parameter for some backend methods

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc
(HIRCompileBase::compile_function_body):
Adjust unit_expression calls.
(HIRCompileBase::unit_expression):
Remove unused Context parameter.
* backend/rust-compile-base.h
(HIRCompileBase::unit_expression): Likewise.
* backend/rust-compile-block.cc
(CompileBlock::visit): Adjust unit_expression calls.
* backend/rust-compile-expr.cc
(CompileExpr::visit): Likewise.
* backend/rust-compile-pattern.cc
(CompilePatternLet::visit): Likewise.
* backend/rust-compile-resolve-path.cc
(ResolvePathRef::attempt_constructor_expression_lookup):
Likewise.
* backend/rust-compile-type.cc
(TyTyResolveCompile::get_implicit_enumeral_node_type):
Remove unused Context parameter.
(TyTyResolveCompile::get_unit_type):
Likewise.
(TyTyResolveCompile::visit):
Adjust get_implicit_enumeral_node_type and get_unit_type calls.
* backend/rust-compile-type.h
(TyTyResolveCompile::get_implicit_enumeral_node_type):
Remove unused Context parameter.
(TyTyResolveCompile::get_unit_type):
Likewise.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
4 months agogccrs: Change singleton returned type to a reference
Pierre-Emmanuel Patry [Wed, 24 Apr 2024 08:51:13 +0000 (10:51 +0200)] 
gccrs: Change singleton returned type to a reference

We do not need a raw pointer for this singleton,
nor we need having it on the heap through a
smart pointer.

gcc/rust/ChangeLog:

* ast/rust-ast.h: Change dereference from a pointer to a reference
accessor.
* ast/rust-expr.h: Likewise.
* ast/rust-item.h: Likewise.
* ast/rust-macro.h: Likewise.
* ast/rust-path.h: Likewise.
* ast/rust-pattern.h: Likewise.
* ast/rust-type.h: Likewise.
* backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address):
Likewise.
* backend/rust-compile-context.h: Likewise.
* backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
(CompileExpr::generate_closure_function): Likewise.
* backend/rust-compile-extern.h: Likewise.
* backend/rust-compile-implitem.cc (CompileTraitItem::visit): Likewise.
* backend/rust-compile-intrinsic.cc (Intrinsics::compile): Likewise.
* backend/rust-compile-item.cc (CompileItem::visit): Likewise.
* backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve):
Likewise.
(HIRCompileBase::query_compile): Likewise.
* backend/rust-compile-type.cc (TyTyResolveCompile::visit): Likewise.
(TyTyResolveCompile::create_dyn_obj_record): Likewise.
* backend/rust-compile.cc (HIRCompileBase::coerce_to_dyn_object):
Likewise.
* backend/rust-mangle-v0.cc (v0_path): Likewise.
(v0_mangle_item): Likewise.
* checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
Likewise.
* checks/errors/privacy/rust-privacy-check.cc (Resolver::resolve):
Likewise.
* checks/errors/rust-const-checker.cc (ConstChecker::ConstChecker):
Likewise.
* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::UnsafeChecker):
Likewise.
* checks/lints/rust-lint-marklive-base.h: Likewise.
* checks/lints/rust-lint-marklive.cc (MarkLive::go): Likewise.
(MarkLive::visit): Likewise.
(MarkLive::visit_path_segment): Likewise.
* checks/lints/rust-lint-marklive.h: Likewise.
* checks/lints/rust-lint-scan-deadcode.h: Likewise.
* expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Likewise.
* expand/rust-macro-expand.h (struct MacroExpander): Change mapping
from pointer to a reference.
* expand/rust-proc-macro.cc (BangProcMacro::BangProcMacro): Replace
pointer accessor with reference accessor.
(AttributeProcMacro::AttributeProcMacro): Likewise.
(CustomDeriveProcMacro::CustomDeriveProcMacro): Likewise.
* hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_lifetime):
Likewise.
(ASTLoweringBase::lower_loop_label): Likewise.
(ASTLoweringBase::lower_path_expr_seg): Likewise.
(ASTLoweringBase::lower_self): Likewise.
(ASTLoweringBase::handle_lang_item_attribute): Likewise.
(ASTLoweringBase::lower_extern_block): Likewise.
(ASTLoweringBase::lower_macro_definition): Likewise.
* hir/rust-ast-lower-base.h: Likewise.
* hir/rust-ast-lower-block.h: Likewise.
* hir/rust-ast-lower-enumitem.h: Likewise.
* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::translate): Likewise.
(ASTLoweringExpr::visit): Likewise.
* hir/rust-ast-lower-extern.h: Likewise.
* hir/rust-ast-lower-implitem.cc (ASTLowerImplItem::translate):
Likewise.
(ASTLowerImplItem::visit): Likewise.
(ASTLowerTraitItem::translate): Likewise.
(ASTLowerTraitItem::visit): Likewise.
* hir/rust-ast-lower-item.cc (ASTLoweringItem::translate): Likewise.
(ASTLoweringItem::visit): Likewise.
(ASTLoweringSimplePath::lower): Likewise.
* hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::translate):
Likewise.
(ASTLoweringPattern::visit): Likewise.
* hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::translate): Likewise.
(ASTLoweringStmt::visit): Likewise.
* hir/rust-ast-lower-struct-field-expr.h: Likewise.
* hir/rust-ast-lower-type.cc (ASTLowerTypePath::visit): Likewise.
(ASTLowerQualifiedPathInType::visit): Likewise.
(ASTLoweringType::translate): Likewise.
(ASTLoweringType::visit): Likewise.
(ASTLowerGenericParam::translate): Likewise.
(ASTLowerGenericParam::visit): Likewise.
(ASTLoweringTypeBounds::translate): Likewise.
(ASTLoweringTypeBounds::visit): Likewise.
(ASTLowerWhereClauseItem::translate): Likewise.
(ASTLowerWhereClauseItem::visit): Likewise.
* hir/rust-ast-lower.cc (ASTLowering::go): Likewise.
(ASTLoweringBlock::visit): Likewise.
(ASTLoweringIfBlock::visit): Likewise.
(ASTLoweringIfLetBlock::visit): Likewise.
(ASTLowerStructExprField::visit): Likewise.
(ASTLoweringExprWithBlock::visit): Likewise.
(ASTLowerPathInExpression::visit): Likewise.
(ASTLoweringBase::lower_qual_path_type): Likewise.
(ASTLowerQualPathInExpression::visit): Likewise.
* metadata/rust-export-metadata.cc (ExportContext::emit_trait):
Likewise.
(ExportContext::emit_function): Likewise.
(ExportContext::emit_macro): Likewise.
(PublicInterface::PublicInterface): Likewise.
(PublicInterface::expected_metadata_filename): Likewise.
* metadata/rust-export-metadata.h: Likewise.
* resolve/rust-ast-resolve-base.h: Likewise.
* resolve/rust-ast-resolve-implitem.h: Likewise.
* resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
Likewise.
(ResolveItem::visit): Likewise.
(ResolveExternItem::visit): Likewise.
* resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path):
Likewise.
* resolve/rust-ast-resolve-stmt.h: Likewise.
* resolve/rust-ast-resolve-toplevel.h: Likewise.
* resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go):
Likewise.
(ResolveTypeToCanonicalPath::visit): Likewise.
* resolve/rust-ast-resolve-type.h: Likewise.
* resolve/rust-ast-resolve.cc (NameResolution::NameResolution):
Likewise.
(NameResolution::go): Likewise.
* resolve/rust-ast-resolve.h: Likewise.
* resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes):
Likewise.
* resolve/rust-early-name-resolver.cc (EarlyNameResolver::EarlyNameResolver):
Likewise.
* resolve/rust-late-name-resolver-2.0.cc (next_node_id): Likewise.
(next_hir_id): Likewise.
* resolve/rust-name-resolution-context.cc (NameResolutionContext::NameResolutionContext):
Likewise.
* resolve/rust-name-resolver.cc (Resolver::Resolver): Likewise.
(Resolver::generate_builtins): Likewise.
(Resolver::setup_builtin): Likewise.
* resolve/rust-name-resolver.h: Likewise.
* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
Likewise.
(TopLevel::handle_use_glob): Likewise.
* rust-session-manager.cc (Session::get_instance): Likewise.
(Session::handle_input_files): Likewise.
(Session::handle_crate_name): Likewise.
(Session::compile_crate): Likewise.
(Session::load_extern_crate): Likewise.
* rust-session-manager.h: Likewise.
* typecheck/rust-autoderef.cc (Adjuster::try_unsize_type): Likewise.
* typecheck/rust-coercion.cc (TypeCoercionRules::do_coercion):
Likewise.
(TypeCoercionRules::coerce_unsafe_ptr): Likewise.
(TypeCoercionRules::coerce_borrowed_pointer): Likewise.
(TypeCoercionRules::coerce_unsized): Likewise.
* typecheck/rust-coercion.h: Likewise.
* typecheck/rust-hir-dot-operator.cc (MethodResolver::select):
Likewise.
* typecheck/rust-hir-inherent-impl-overlap.h: Likewise.
* typecheck/rust-hir-path-probe.cc (PathProbeType::process_enum_item_for_candiates):
Likewise.
(PathProbeType::process_impl_items_for_candidates): Likewise.
(PathProbeImplTrait::process_trait_impl_items_for_candidates):
Likewise.
* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait):
Likewise.
(TraitItemReference::get_parent_trait_mappings): Likewise.
* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_literal):
Likewise.
(TypeCheckBase::get_marker_predicate): Likewise.
* typecheck/rust-hir-type-check-base.h: Likewise.
* typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit):
Likewise.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
Likewise.
(TypeCheckExpr::resolve_operator_overload): Likewise.
(TypeCheckExpr::resolve_fn_trait_call): Likewise.
* typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit):
Likewise.
(TypeCheckImplItem::visit): Likewise.
* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
Likewise.
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
Likewise.
(TypeCheckExpr::resolve_segments): Likewise.
* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::emit_pattern_size_error):
Likewise.
(ClosureParamInfer::Resolve): Likewise.
* typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve):
Likewise.
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): Likewise.
(TypeCheckType::resolve_root_path): Likewise.
(TypeResolveGenericParam::visit): Likewise.
(ResolveWhereClauseItem::visit): Likewise.
* typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn):
Likewise.
* typecheck/rust-type-util.cc (query_type): Likewise.
* typecheck/rust-typecheck-context.cc (TypeCheckContext::compute_inference_variables):
Likewise.
* typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Likewise.
(TypeBoundsProbe::assemble_builtin_candidate): Likewise.
(TypeCheckBase::get_predicate_from_bound): Likewise.
* typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Likewise.
(TypeCheckMethodCallExpr::check): Likewise.
* typecheck/rust-tyty-call.h: Likewise.
* typecheck/rust-tyty-cmp.h: Likewise.
* typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::override_context):
Likewise.
(SubstitutionRef::monomorphize): Likewise.
* typecheck/rust-tyty-util.cc (TyVar::get_implicit_infer_var):
Likewise.
(TyVar::monomorphized_clone): Likewise.
(TyWithLocation::TyWithLocation): Likewise.
* typecheck/rust-tyty.cc (BaseType::satisfies_bound): Likewise.
(InferType::clone): Likewise.
(ADTType::handle_substitions): Likewise.
(TupleType::handle_substitions): Likewise.
(FnType::handle_substitions): Likewise.
(ClosureType::setup_fn_once_output): Likewise.
(ArrayType::handle_substitions): Likewise.
(SliceType::handle_substitions): Likewise.
(ReferenceType::handle_substitions): Likewise.
(PointerType::handle_substitions): Likewise.
(ParamType::handle_substitions): Likewise.
* typecheck/rust-tyty.h: Likewise.
* typecheck/rust-unify.cc (UnifyRules::UnifyRules): Likewise.
(UnifyRules::commit): Likewise.
* util/rust-hir-map.cc: Change getter return type to a reference.
* util/rust-hir-map.h: Update function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
4 months agogccrs: Remove unnecessary SIDE_EFFECTS/READONLY macros
Mael Cravero [Tue, 30 Apr 2024 10:04:50 +0000 (12:04 +0200)] 
gccrs: Remove unnecessary SIDE_EFFECTS/READONLY macros

Closes #2357

gcc/rust/ChangeLog:

* rust-gcc.cc: remove unnecessary TREE_SIDE_EFFECTS and TREE_READONLY
macros used in arithmetic overflow checks.

Signed-off-by: Mael Cravero <mael.cravero@embecosm.com>
4 months agogccrs: borrowck: Use std::ignore
Jakub Dupak [Wed, 24 Apr 2024 12:32:48 +0000 (14:32 +0200)] 
gccrs: borrowck: Use std::ignore

gcc/rust/ChangeLog:

* checks/errors/borrowck/rust-bir-builder-expr-stmt.cc
(ExprStmtBuilder::visit): Use std::ignore.

4 months agogccrs: borrowck: Testsuite
Jakub Dupak [Wed, 24 Apr 2024 11:47:20 +0000 (13:47 +0200)] 
gccrs: borrowck: Testsuite

gcc/testsuite/ChangeLog:

* rust/borrowck/borrowck.exp: New test.
* rust/borrowck/position_dependant_outlives.rs: New test.
* rust/borrowck/reference.rs: New test.
* rust/borrowck/return_ref_to_local.rs: New test.
* rust/borrowck/subset.rs: New test.
* rust/borrowck/test_move.rs: New test.
* rust/borrowck/test_move_behind_reference.rs: New test.
* rust/borrowck/test_move_conditional.rs: New test.
* rust/borrowck/tmp.rs: New test.
* rust/borrowck/use_while_mut.rs: New test.
* rust/borrowck/use_while_mut_fr.rs: New test.
* rust/borrowck/well_formed_function_inputs.rs: New test.

4 months agogccrs: borrowck: Polonius error reporting
Jakub Dupak [Tue, 27 Feb 2024 23:01:28 +0000 (00:01 +0100)] 
gccrs: borrowck: Polonius error reporting

gcc/rust/ChangeLog:

* checks/errors/borrowck/ffi-polonius/src/gccrs_ffi_generated.rs: Error reporting.
* checks/errors/borrowck/ffi-polonius/src/lib.rs: Error reporting.
* checks/errors/borrowck/polonius/rust-polonius-ffi.h (struct FactsView):
Error reporting.
(struct Output): Error reporting.
* checks/errors/borrowck/polonius/rust-polonius.h (struct Facts): Error reporting.
* checks/errors/borrowck/rust-borrow-checker.cc: Error reporting.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
4 months agogccrs: borrowck: Link Polonius and run it
Jakub Dupak [Tue, 27 Feb 2024 22:59:36 +0000 (23:59 +0100)] 
gccrs: borrowck: Link Polonius and run it

gcc/rust/ChangeLog:

* Make-lang.in: Link Polonius.
* checks/errors/borrowck/rust-borrow-checker.cc: Run Polonius.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
4 months agogccrs: borrowck: Build Polonius automatically
Jakub Dupak [Tue, 27 Feb 2024 23:08:01 +0000 (00:08 +0100)] 
gccrs: borrowck: Build Polonius automatically

This is minimalistic version to build Polonius with Cargo.

gcc/rust/ChangeLog:

* Make-lang.in: Build Polonius.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
4 months agogccrs: borrowck: Polonius dump
Jakub Dupak [Tue, 27 Feb 2024 22:52:53 +0000 (23:52 +0100)] 
gccrs: borrowck: Polonius dump

gcc/rust/ChangeLog:

* checks/errors/borrowck/polonius/rust-polonius.h (struct FullPoint):
Polonius facts dump.
(struct Facts): Polonius facts dump.
* checks/errors/borrowck/rust-bir-dump.cc (Dump::go):
Polonius facts dump.
(Dump::visit): Polonius facts dump.
(Dump::visit_place): Polonius facts dump.
(Dump::visit_move_place): Polonius facts dump.
(Dump::visit_scope): Polonius facts dump.
* checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go): Polonius facts dump.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
4 months agogccrs: Removed obsolete objects
Kushal Pal [Wed, 24 Apr 2024 06:04:53 +0000 (06:04 +0000)] 
gccrs: Removed obsolete objects

gcc/rust/ChangeLog:

* backend/rust-compile-expr.cc (CompileExpr::visit): Lines
removed as the objects are unused.

Signed-off-by: Kushal Pal <kushalpal109@gmail.com>
4 months agogccrs: Remove redundant macro definition
zhanghe9702 [Sun, 24 Mar 2024 08:48:56 +0000 (16:48 +0800)] 
gccrs: Remove redundant macro definition

gcc/rust/ChangeLog:
* backend/rust-tree.h: removing the CLASSTYPE_VBASECLASSES macro
which is duplicated three times.

Signed-off-by: Zhang He <zhanghe9702@163.com>
4 months agogccrs: git: Ignore libgrust build folders
Arthur Cohen [Mon, 29 Jan 2024 15:17:00 +0000 (16:17 +0100)] 
gccrs: git: Ignore libgrust build folders

ChangeLog:

* .gitignore: Add libgrust target folders to the ignore list.

4 months agogccrs: contrib: Add libgrust to update-copyright.py script
Sahil Yeole [Thu, 15 Feb 2024 20:45:17 +0000 (02:15 +0530)] 
gccrs: contrib: Add libgrust to update-copyright.py script

contrib/ChangeLog:
* update-copyright.py: Add libgrust folder.

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
4 months agotestsuite: Add -gno-strict-dwarf option to dwarf2 inline[26].c tests
John David Anglin [Mon, 17 Mar 2025 15:33:01 +0000 (11:33 -0400)] 
testsuite: Add -gno-strict-dwarf option to dwarf2 inline[26].c tests

Some targets default to strict dwarf.

2025-03-17  John David Anglin  <danglin@gcc.gnu.org>

gcc/testsuite/ChangeLog:

PR testsuite/119220
* gcc.dg/debug/dwarf2/inline2.c: Add -gno-strict-dwarf option.
* gcc.dg/debug/dwarf2/inline6.c: Likewise.

4 months agolibphobos: Add sqlite3 and odbc bindings
Iain Buclaw [Sat, 15 Mar 2025 14:28:10 +0000 (15:28 +0100)] 
libphobos: Add sqlite3 and odbc bindings

Phobos changes:

- Add ODBC 4.0 modules to replace deprecated druntime bindings.
- Add SQLite 3.x module.

libphobos/ChangeLog:

* src/Makefile.am (PHOBOS_DSOURCES): Add etc/c/odbc/odbc32.d,
etc/c/odbc/odbc64.d, etc/c/odbc/package.d, etc/c/odbc/sql.d,
etc/c/odbc/sqlext.d, etc/c/odbc/sqltypes.d, etc/c/odbc/sqlucode.d,
etc/c/sqlite3.d.
* src/Makefile.in: Regenerate.
* src/etc/c/odbc/odbc32.d: New file.
* src/etc/c/odbc/odbc64.d: New file.
* src/etc/c/odbc/package.d: New file.
* src/etc/c/odbc/sql.d: New file.
* src/etc/c/odbc/sqlext.d: New file.
* src/etc/c/odbc/sqltypes.d: New file.
* src/etc/c/odbc/sqlucode.d: New file.
* src/etc/c/sqlite3.d: New file.

4 months agodoc: document Incremental LTO flags
Michal Jires [Thu, 13 Mar 2025 15:18:10 +0000 (16:18 +0100)] 
doc: document Incremental LTO flags

This adds missing documentation for LTO flags.

gcc/ChangeLog:

* doc/invoke.texi: (Optimize Options):
Add incremental LTO flags.

4 months agotestsuite: s390: Skip gcc.dg/vect/bb-slp-77.c
Stefan Schulze Frielinghaus [Mon, 17 Mar 2025 13:07:52 +0000 (14:07 +0100)] 
testsuite: s390: Skip gcc.dg/vect/bb-slp-77.c

There exists no .REDUC_PLUS on s390.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/bb-slp-77.c: Skip on s390.

4 months agoMove gfortran.dg/gomp/declare-variant-mod-1*.f90 to libgomp.fortran/ [PR115271]
Tobias Burnus [Mon, 17 Mar 2025 09:12:44 +0000 (10:12 +0100)] 
Move gfortran.dg/gomp/declare-variant-mod-1*.f90 to libgomp.fortran/ [PR115271]

The test is a supposed to be a compile-only test but as dg-additional-sources
does not work with dg-compile (due to compiling with '-o'), dg-link had to
be used; as the code actually compiles (no diagnostic error), the linker
is actually invoked, which fails unless the system compiler by chance
provides the required files. Solution: move the test to libgomp.

PR fortran/115271

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/declare-variant-mod-1-use.f90: Move to
libgomp/testsuite/libgomp.fortran/.
* gfortran.dg/gomp/declare-variant-mod-1.f90: Likewise.

libgomp/ChangeLog:

* testsuite/libgomp.fortran/declare-variant-mod-1-use.f90: Moved
from gcc/testsuite/gfortran.dg/gomp/.
* testsuite/libgomp.fortran/declare-variant-mod-1.f90: Likewise.

4 months agoRISC-V: Mask values before initializing bitmask vector [PR119114].
Robin Dapp [Tue, 11 Mar 2025 13:30:48 +0000 (14:30 +0100)] 
RISC-V: Mask values before initializing bitmask vector [PR119114].

In the somewhat convoluted vector code of PR119114 we extract a
<signed-boolean:1> mask value from a vector mask.  After some middle-end
simplifications we end up with a value of -2.  Its lowest bit is
correctly unset representing "false".  When initializing a bitmak vector
from values we compare the full value/register against zero instead of
just the last bit.  This causes erroneous mask values.

This patch masks the values by & 0x1 before comparing against 0.

PR target/119114

gcc/ChangeLog:

* config/riscv/autovec.md: Apply & 0x1 mask when initializing
bitmask vector.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr119114.c: New test.

4 months agoAarch64: Add FMA and FMAF intrinsic and corresponding tests
Ayan Shafqat [Mon, 17 Mar 2025 08:28:27 +0000 (09:28 +0100)] 
Aarch64: Add FMA and FMAF intrinsic and corresponding tests

This patch introduces inline definitions for the __fma and __fmaf
functions in arm_acle.h for Aarch64 targets. These definitions rely on
__builtin_fma and __builtin_fmaf to ensure proper inlining and to meet
the ACLE requirements [1].

The patch has been tested locally using a crosstool-NG sysroot for
Aarch64, confirming that the generated code uses the expected fused
multiply-accumulate instructions (fmadd).

[1] https://arm-software.github.io/acle/main/acle.html#fused-multiply-accumulate-fma

gcc/ChangeLog:

* config/aarch64/arm_acle.h (__fma, __fmaf): New functions.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/acle/acle_fma.c: New test.

4 months agoAdd -[DU]_FORTIFY_SOURCE[=n] to DW_AT_producer
Richard Biener [Thu, 13 Mar 2025 13:29:06 +0000 (14:29 +0100)] 
Add -[DU]_FORTIFY_SOURCE[=n] to DW_AT_producer

The following makes sure to record -D_FORTIFY_SOURCE=n and
-U_FORTIFY_SOURCE in the DW_AT_producer debuginfo attribute when
present on the compiler command line.

* opts.cc (gen_producer_string): Record -D and -U
with _FORTIFY_SOURCE prefix.

4 months agoDaily bump.
GCC Administrator [Mon, 17 Mar 2025 00:16:48 +0000 (00:16 +0000)] 
Daily bump.

4 months ago[RISC-V][PR target/116256][V4] Fix minor code quality regression in reassociated...
Jeff Law [Sun, 16 Mar 2025 23:43:48 +0000 (17:43 -0600)] 
[RISC-V][PR target/116256][V4] Fix minor code quality regression in reassociated arithmetic

Arggh.  This time add arguments for rv32.  Hand edited the testcase part of the
patch, but I think I got it right.

One.  More.  Time.

-pedantic-errors this time ;(  Adding an explicit -std=gnu23 to shut that up.
Part of me wants to know why that's getting added by the pre-commit, but not
enough to chase it down.

--

This failed pre-commit CI the first time through. The only change is in the
return type in the test bool -> _Bool.

The patch for target/116256 significantly simplified the condition and, I guess
not too surprisingly, exposed a minor code quality regression.

Specifically the split part of the define_insn_and_split only splits after
reload (because we use a match_scratch).  So there's nothing to combine the
load-immediate with the subsequent add into an addi when the immediate fits
into a simm12 field.

This patch adjusts the split code to handle that scenario directly and generate
the more efficient code.  We can squeeze out the slli in this test with a bit
more work, but that's out of scope right now since that isn't a regression.

Tested in my tester.  Waiting on pre-commit testing to render a verdict.

PR target/116256
gcc
* config/riscv/riscv.md (reassociation splitters): Do not load the
adjusted addend into a register if it fits in a simm12.

gcc/testsuite
* gcc.target/riscv/pr116256-1.c: New test.

4 months agoFortran: fix bogus dependency check in ALLOCATE statement [PR60560]
Harald Anlauf [Sat, 15 Mar 2025 14:11:22 +0000 (15:11 +0100)] 
Fortran: fix bogus dependency check in ALLOCATE statement [PR60560]

Restrict dependency check of ALLOCATE object to variables in the same
statement, but exclude check of length type parameter that might be
set in the declaration and could lead to a bogus cyclic dependency.

PR fortran/60560

gcc/fortran/ChangeLog:

* expr.cc (gfc_traverse_expr): Do not descend into length type
parameter for negative values of auxiliary parameter f.
* resolve.cc (gfc_find_var_in_expr): New helper function to check
dependence of an expression on given variable.
(resolve_allocate_expr): Use it to determine if array bounds in an
ALLOCATE statement depend explicitly on a variable.

gcc/testsuite/ChangeLog:

* gfortran.dg/allocate_error_8.f90: New test.

4 months agod: Merge upstream dmd, druntime 603225372b
Iain Buclaw [Fri, 14 Mar 2025 22:08:16 +0000 (23:08 +0100)] 
d: Merge upstream dmd, druntime 603225372b

D front-end changes:

- Import dmd v2.111.0-beta.1.
- Added placement `new' expressions.

D runtime changes:

- Import druntime v2.111.0-beta.1.

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd 603225372b.
* dmd/VERSION: Bump version to v2.111.0-beta.1.
* d-builtins.cc (build_frontend_type): Update for new front-end
interface.
* decl.cc (Class DeclVisitor): Likewise.
(maybe_build_decl_tree): Likewise.
(get_vtable_decl): Likewise.
(layout_class_initializer): Likewise.
* expr.cc (class ExprVisitor): Likewise.
(ExprVisitor::visit (NewExp *)): Implement placement new for class,
struct, and pointer types.
* modules.cc (get_internal_fn): Update for new front-end interface.

libphobos/ChangeLog:

* libdruntime/MERGE: Merge upstream druntime 603225372b.

4 months agod: Merge upstream dmd, druntime 53a1cc8d13
Iain Buclaw [Fri, 14 Mar 2025 00:36:45 +0000 (01:36 +0100)] 
d: Merge upstream dmd, druntime 53a1cc8d13

D front-end changes:

- Typesafe variadic class parameters have been deprecated.

D runtime changes:

- Added `entry' field to TypeInfo_AssociativeArray.

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd 53a1cc8d13.
* d-tree.h (create_typeinfo): Change second parameter to Scope *.
(speculative_type_p): Remove prototype.
* d-frontend.cc (getTypeInfoType): Adjust.
* decl.cc: Include dmd/typinf.h.
(DeclVisitor::visit (TypeInfoDeclaration *)): Update for new front-end
interface.
* typeinfo.cc (create_typeinfo): Likewise.
(class SpeculativeTypeVisitor): Remove class.
(speculative_type_p): Remove function.

libphobos/ChangeLog:

* libdruntime/MERGE: Merge upstream druntime 53a1cc8d13.

gcc/testsuite/ChangeLog:

* gdc.dg/pr100967.d: Adjust error message.

4 months agocobol: add cobol.dg/group1/escape.cob test; modify cobol.dg/gd.exp to handle it
Robert Dubner [Sun, 16 Mar 2025 16:20:01 +0000 (12:20 -0400)] 
cobol: add cobol.dg/group1/escape.cob test; modify cobol.dg/gd.exp to handle it

gcc/testsuite

* cobol.dg/dg.exp: modified to recurse into directories without
.exp files and find *.cob files therein.
* cobol.dg/group1/escape.cob: New testcase.

4 months agodiscriminators: Fix assigning discriminators on edge [PR113546]
Andrew Pinski [Sat, 15 Mar 2025 23:37:41 +0000 (16:37 -0700)] 
discriminators: Fix assigning discriminators on edge [PR113546]

The problem here is there was a compare debug since the discriminators
would still take into account debug statements. For the edge we would look
at the first statement after the labels and that might have been a debug statement.
So we need to skip over debug statements otherwise we could get different
discriminators # with and without -g.

Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR middle-end/113546

gcc/ChangeLog:

* tree-cfg.cc (first_non_label_stmt): Rename to ...
(first_non_label_nondebug_stmt): This and use gsi_start_nondebug_after_labels_bb.
(assign_discriminators): Update call to first_non_label_nondebug_stmt.

gcc/testsuite/ChangeLog:

* c-c++-common/torture/pr113546-1.c: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
4 months agoPR modula2/115111 Incorrect line debugging locations at the end of the WHILE loop
Gaius Mulley [Sun, 16 Mar 2025 15:56:48 +0000 (15:56 +0000)] 
PR modula2/115111 Incorrect line debugging locations at the end of the WHILE loop

This fix corrects the END token position used during the GotoOp at the
bottom of the WHILE loop.  The fix is to pass the relative token position
down to M2Quads.  This method should be replicated for the other loops
END or UNTIL keywords and possibly the END statements for
conditional statements.

gcc/m2/ChangeLog:

PR modula2/115111
* gm2-compiler/M2GenGCC.mod (CodeStatementNote): Add debugging.
* gm2-compiler/M2Quads.def (BuildEndWhile): New parameter reltokpos.
* gm2-compiler/M2Quads.mod (BuildEndWhile): Reimplement using new parameter.
* gm2-compiler/P3Build.bnf (WhileStatement): Call BuildEndWhile
with -1 relative position.
* gm2-gcc/m2block.cc (do_add_stmt): Tidy comment.
(GetGlobals): Ditto.
(flush_pending_note): Remove #if 0 code.
* gm2-gcc/m2pp.cc (m2pp_nop_expr): New function.
(m2pp_statement): New case clause call m2pp_nop_expr.

gcc/testsuite/ChangeLog:

PR modula2/115111
* gm2/pim/pass/whilestep.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
4 months agoDarwin: Pass -macos_version_min to the linker [PR119172].
Iain Sandoe [Sun, 9 Mar 2025 09:24:34 +0000 (09:24 +0000)] 
Darwin: Pass -macos_version_min to the linker [PR119172].

For binaries to be notarised, the SDK version must be available.
Since we do not, at present, parse this information we have been
passing "0.0" to ld64.  This now results in a warning and a fail
to notarise.  As a quick-fix, we can fall back to letting ld64
figure out the SDK version (which it does for -macos_version_min).

TODO: Parse the SDKSetting.plist at some point.

PR target/119172

gcc/ChangeLog:

* config.in: Regenerate.
* config/darwin.h (DARWIN_PLATFORM_ID): Add the option to
use -macos_version_min where available.
* configure: Regenerate.
* configure.ac: Check for ld64 support of -macos_version_min.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
(cherry picked from commit 36f5ea5806d246d78555e65273a057718833e3cd)

4 months agod: Merge upstream dmd, druntime ffbad272b6
Iain Buclaw [Thu, 13 Mar 2025 22:58:49 +0000 (23:58 +0100)] 
d: Merge upstream dmd, druntime ffbad272b6

D front-end changes:

- Import latest fixes from dmd.

D runtime changes:

- Import latest fixes from druntime.

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd ffbad272b6.
* d-tree.h (make_location_t): Add overload taking a const SourceLoc &.
* d-codegen.cc (make_location_t): Likewise.
* d-diagnostic.cc (d_diagnostic_report_diagnostic): Change first
parameter type to const SourceLoc &.
(verrorReport): Update for new front-end interface.
(verrorReportSupplemental): Likewise.
* d-frontend.cc (eval_builtin): Likewise.
(getTypeInfoType): Likewise.
* d-lang.cc (d_parse_file): Likewise.
* d-target.cc (Target::va_listType): Likewise.
(Target::getTargetInfo): Likewise.
* decl.cc (build_decl_tree): Likewise.
* imports.cc (ImportVisitor::visit (Module *)): Likewise.
* modules.cc (get_internal_fn): Likewise.

libphobos/ChangeLog:

* libdruntime/MERGE: Merge upstream druntime ffbad272b6.

4 months agoDaily bump.
GCC Administrator [Sun, 16 Mar 2025 00:16:56 +0000 (00:16 +0000)] 
Daily bump.

4 months agod: Merge upstream dmd, druntime d29e3eca45
Iain Buclaw [Wed, 12 Mar 2025 17:16:46 +0000 (18:16 +0100)] 
d: Merge upstream dmd, druntime d29e3eca45

D front-end changes:

- Error messages related to operator overloading have been improved.

D runtime changes:

- Import latest fixes from druntime.

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd d29e3eca45.
* d-codegen.cc (can_elide_copy_p): Update for new front-end interface.
* d-lang.cc (d_handle_option): Likewise.
* expr.cc (class ExprVisitor): Likewise.

libphobos/ChangeLog:

* libdruntime/MERGE: Merge upstream druntime d29e3eca45.

4 months agod: Merge upstream dmd, druntime b7e3b3b617
Iain Buclaw [Wed, 12 Mar 2025 16:19:49 +0000 (17:19 +0100)] 
d: Merge upstream dmd, druntime b7e3b3b617

D front-end changes:

- `delete' is no longer a keyword.
- Initializing a field with itself has been deprecated.

D runtime changes:

- Add Windows BCrypt bindings under `core.sys.windows.bcrypt'.

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream b7e3b3b617.

libphobos/ChangeLog:

* libdruntime/MERGE: Merge upstream b7e3b3b617.
* libdruntime/Makefile.am (DRUNTIME_DSOURCES_WINDOWS): Add
core/sys/windows/bcrypt.d.
* libdruntime/Makefile.in: Regenerate.
* libdruntime/gcc/sections/elf.d (sizeofTLS): Give function the same
mangling as gcc.sections.sizeofTLS.
* libdruntime/gcc/sections/package.d: Import core.internal.traits.
(pinLoadedLibraries): Mangle as function from rt.sections_elf_shared.
(unpinLoadedLibraries): Likewise.
(inheritLoadedLibraries): Likewise.
(cleanupLoadedLibraries): Likewise.
(sizeOfTLS): Add forward declaration.

4 months agocontrib/gcc-changelog: Fix Git.AutoInterrupt - sys.meta_path is None exception
Tobias Burnus [Sat, 15 Mar 2025 07:53:18 +0000 (08:53 +0100)] 
contrib/gcc-changelog: Fix Git.AutoInterrupt - sys.meta_path is None exception

I think the following message is new with Python 3.13, at least I starting
seeing the following exception, which could be fixed by a simple call
to 'repo.close()'.

Seemingly the issue was that the lifetime of the destructor exceeded the
object lifetime.

  Exception ignored in: <function Git.AutoInterrupt.__del__ at 0x7ff995aa4f40>
  Traceback (most recent call last):
    File "/usr/lib/python3.13/site-packages/git/cmd.py", line 790, in __del__
    File "/usr/lib/python3.13/site-packages/git/cmd.py", line 781, in _terminate
    File "/usr/lib64/python3.13/subprocess.py", line 2227, in terminate
  ImportError: sys.meta_path is None, Python is likely shutting down

contrib/ChangeLog:

* gcc-changelog/git_repository.py (parse_git_revisions): Destroy the
Repo object by calling repo.close() at the end of the function.

4 months agoFortran: Store OpenMP's 'declare variant' in module file [PR115271]
Tobias Burnus [Sat, 15 Mar 2025 07:28:11 +0000 (08:28 +0100)] 
Fortran: Store OpenMP's 'declare variant' in module file [PR115271]

Write the 'omp declare variant' data into the .mod file: Base function,
variant function(s), supporting the clauses match, append_args, and
adjust_args.

PR fortran/115271

gcc/fortran/ChangeLog:

* module.cc (mio_omp_declare_simd_clauses): New, moved from ...
(mio_omp_declare_simd): ... here. Update call, write empty '( )'
if there is no declare simd but a declare variant.
(mio_omp_declare_variant): New.
(mio_symbol): Call it.
* openmp.cc (gfc_match_omp_context_selector): Add comment about
module.cc to TODO note.
* trans-stmt.h (gfc_trans_omp_declare_variant): Take additional
parent_ns argument.
* trans-decl.cc (create_function_arglist,
gfc_create_function_decl): Update call.
* trans-openmp.cc (gfc_trans_omp_declare_variant): Take new
argument, add some special case handling for attr.use_assoc.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/declare-variant-mod-1-use.f90: New test.
* gfortran.dg/gomp/declare-variant-mod-1.f90: New test.
* gfortran.dg/gomp/declare-variant-mod-2-use.f90: New test.
* gfortran.dg/gomp/declare-variant-mod-2.f90: New test.

4 months agoRISC-V: Refine the testcases for cond_widen_complicate-3
Pan Li [Wed, 12 Mar 2025 03:26:52 +0000 (11:26 +0800)] 
RISC-V: Refine the testcases for cond_widen_complicate-3

Rearrange the test cases of cond_widen_complicate-3 by different types
into different files, instead of put all types together.  Then we can
easily reduce the range when asm check fails.

The below test suites are passed locally, let's wait online CI says.
* The rv64gcv fully regression test.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3.c: Removed.
* gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-f16.c: New test.
* gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-f32.c: New test.
* gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-i16.c: New test.
* gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-i32.c: New test.
* gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-i8.c: New test.
* gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-u16.c: New test.
* gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-u32.c: New test.
* gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-u8.c: New test.
* gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3.h: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
4 months agoDaily bump.
GCC Administrator [Sat, 15 Mar 2025 00:17:37 +0000 (00:17 +0000)] 
Daily bump.

4 months agoRegenerate .pot files
Joseph Myers [Fri, 14 Mar 2025 22:08:00 +0000 (22:08 +0000)] 
Regenerate .pot files

gcc/po/
* gcc.pot: Regenerate.

libcpp/po/
* cpplib.pot: Regenerate.

4 months agolibstdc++: Missing 'constexpr' in vector's from_range ctor [PR119282]
Patrick Palka [Fri, 14 Mar 2025 20:10:35 +0000 (16:10 -0400)] 
libstdc++: Missing 'constexpr' in vector's from_range ctor [PR119282]

A missing 'constexpr' in the non-forward (and non-sized) branch of our
recently implemented vector from_range ctor was causing this valid example
to be rejected with a cryptic error.

PR libstdc++/119282

libstdc++-v3/ChangeLog:

* include/bits/stl_vector.h (vector::vector(from_range_t)): Add
missing 'constexpr' to local class _Clear.
* testsuite/std/ranges/conv/1.cc (test_pr119282): New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
4 months agocobol: Don't run cobol tests with -m32 or -mx32 [PR119290]
Jakub Jelinek [Fri, 14 Mar 2025 19:32:43 +0000 (20:32 +0100)] 
cobol: Don't run cobol tests with -m32 or -mx32 [PR119290]

The following patch adds cobol effective target and uses it to guard main
loop in cobol.dg/dg.exp, so that we don't run the tests on unsupported
multilibs.

Tested on x86_64-linux with
make check-cobol RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} dg.exp'
which previously had all FAILs in the -m32 case and now doesn't report
any PASSes/FAILs/XFAILs/XPASSes etc, while for -m64 the testsuite is run
normally.

2025-03-14  Jakub Jelinek  <jakub@redhat.com>

PR cobol/119290
* lib/target-supports.exp (check_compile): Use *.cob extension for
"*> COBOL" comment.
* lib/cobol-dg.exp (check_effective_target_cobol): New procedure.
* cobol.dg/dg.exp: Guard main loop with [check_effective_target_cobol]
test.

4 months agoipa: Do not modify cgraph edges from thunk clones during inlining (PR116572)
Martin Jambor [Fri, 14 Mar 2025 15:07:01 +0000 (16:07 +0100)] 
ipa: Do not modify cgraph edges from thunk clones during inlining (PR116572)

In PR 116572 we hit an assert that a thunk which does not have a body
looks like it has one.  It does not, but the call_stmt of its outgoing
edge points to a statement, which should not.  In fact it has several
outgoing call graph edges, which cannot be.  The problem is that the
code updating the edges to reflect inlining into the master clone (an
ex-thunk, unlike the clone, which is still an unexpanded thunk) is
being updated during inling into the master clone.  This patch simply
makes the code to skip unexpanded thunk clones.

gcc/ChangeLog:

2025-03-13  Martin Jambor  <mjambor@suse.cz>

PR ipa/116572
* cgraph.cc (cgraph_update_edges_for_call_stmt): Do not update
edges of clones that are unexpanded thunk.  Assert that the node
passed as the parameter is not an unexpanded thunk.

gcc/testsuite/ChangeLog:

2025-03-13  Martin Jambor  <mjambor@suse.cz>

PR ipa/116572
* g++.dg/ipa/pr116572.C: New test.

4 months agomatch.pd: Fix up r15-8025 simplification [PR119287]
Jakub Jelinek [Fri, 14 Mar 2025 14:34:32 +0000 (15:34 +0100)] 
match.pd: Fix up r15-8025 simplification [PR119287]

The following testcase ICEs since r15-8025.
tree_nop_conversion_p doesn't imply TREE_TYPE (@0) is uselessly convertible
to type, e.g. they could be INTEGER_TYPEs with the same precision but
different TYPE_SIGN.

The following patch just adds a convert so that it creates a valid IL
even in those cases.

2025-03-14  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/119287
* match.pd (((X >> C1) & C2) * (1 << C1) to X & (C2 << C1)): Use
(convert @0) instead of @0 in the substitution.

* gcc.dg/pr119287.c: New test.

4 months agoc, c++: Set DECL_NOT_GIMPLE_REG_P on *PART_EXPR operand on lhs of MODIFY_EXPR [PR119120]
Jakub Jelinek [Fri, 14 Mar 2025 14:31:47 +0000 (15:31 +0100)] 
c, c++: Set DECL_NOT_GIMPLE_REG_P on *PART_EXPR operand on lhs of MODIFY_EXPR [PR119120]

The PR119190 patch I've posted regresses the PR119120 testcase (not adding
to testsuite, as it is fairly hard to scan for that problem).
The issue is that for the partial setting of _Complex floating vars
through __real__ on it first and __imag__ later (or vice versa) and since
we forced all complex vars into SSA form we often have undefined (D)
arguments of those COMPLEX_EXPRs.  When we don't DCE them (for -O0 debug
info reasons), their expansion will copy both the real and imag parts
using the floating mode and on some targets like 387 that copying alone can
unfortunately trigger exceptions on sNaNs or other problematic bit patterns
and for uninitialized memory it can be triggered randomly based on whatever
is on the stack before.

The following patch sets DECL_NOT_GIMPLE_REG_P flag in the FEs during
genericization.
I think Fortran doesn't have a way to modify just real or just complex
part separately.

The patch is for code like
          _ComplexT __t;
          __real__ __t = __z.real();
          __imag__ __t = __z.imag();
          _M_value *= __t;
          return *this;
at -O0 which used to appear widely even in libstdc++ before GCC 9
and happens in real-world code.  At -O0 for debug info reasons (see
PR119190) we don't want to aggressively DCE statements and when we
since r0-100845 try to rewrite vars with COMPLEX_TYPE into SSA form
aggressively, the above results in copying of uninitialized data
when expanding COMPLEX_EXPRs added so that the vars can be in SSA form.
The patch detects during genericization the partial initialization and
doesn't rewrite such vars to SSA at -O0.  This has to be done before
gimplification starts, otherwise e.g. the attached testcase ICEs.

2025-03-14  Jakub Jelinek  <jakub@redhat.com>

PR target/119120
* c-gimplify.cc (c_genericize_control_r): Set DECL_NOT_GIMPLE_REG_P
on {REAL,IMAG}PART_EXPR is_gimple_reg operand at -O0 if it is lhs
of a MODIFY_EXPR.

* cp-gimplify.cc (cp_genericize_r): Set DECL_NOT_GIMPLE_REG_P
on {REAL,IMAG}PART_EXPR is_gimple_reg operand at -O0 if it is lhs
of a MODIFY_EXPR.

* c-c++-common/pr119120.c: New test.

4 months agoanalyzer: Fix ICE in cmp_csts_same_type on RAW_DATA_CST [PR119278]
Jakub Jelinek [Fri, 14 Mar 2025 14:30:43 +0000 (15:30 +0100)] 
analyzer: Fix ICE in cmp_csts_same_type on RAW_DATA_CST [PR119278]

The following testcase ICEs in cmp_csts_same_type because RAW_DATA_CST
isn't handled there.  As TREE_TYPE (cst1) in that case is INTEGER_TYPE,
e.g. char/signed char/unsigned char, the type itself doesn't imply
the size, so the length is compared first, followed by comparing the
data.
While at it, I've noticed STRING_CST handling is wrong, because STRING_CST
can represent even string literals with embedded nul characters.
We shouldn't stop at those, hence memcmp.
While for STRING_CST TREE_TYPE should likely already imply the length
and so same type should imply same TREE_STRING_LENGTH, I've repeated
the comparisons in there just in case.

2025-03-14  Jakub Jelinek  <jakub@redhat.com>

PR analyzer/119278
* svalue.cc (cmp_csts_same_type): For STRING_CST, compare
TREE_STRING_LENGTH first just in case and use memcmp rather
than strcmp.  Handle RAW_DATA_CST.

* c-c++-common/analyzer/pr119278.c: New test.

4 months agolibstdc++: Fix views::zip_transform constraints for empty range pack [PR111138]
Tomasz Kamiński [Fri, 7 Mar 2025 10:54:38 +0000 (11:54 +0100)] 
libstdc++: Fix views::zip_transform constraints for empty range pack [PR111138]

Add missing move_constructible && regular_invocable constrains on functor type,
and is_object on functor result type for invocations of views::zip_transform
without range arguments.

PR libstdc++/111138

libstdc++-v3/ChangeLog:

* include/std/ranges (_ZipTransform::operator()):
Create separate overload for calls with empty range pack,
and add move_constructible, regular_invocable and
is_object_v<invoke_result_t<...>>> constraints.
* testsuite/std/ranges/zip_transform/1.cc: New tests

Reviewed-by: Patrick Palka <ppalka@redhat.com>
Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 months agoPrevent use of ASM_EXPR for optimized COBOL compilations [PR119214]
Robert Dubner [Fri, 14 Mar 2025 01:03:46 +0000 (21:03 -0400)] 
Prevent use of ASM_EXPR for optimized COBOL compilations [PR119214]

The creation of assembler labels using ASM_EXPR causes name collisions in the
assembly language because some optimizations repeat code, and those labels
can get repeated. Use of "if( !optimize )" prevents (at least) that problem when
it cropped up with "-O -ftrace"

gcc/cobol:

PR cobol/119214
* gengen.cc: applies if( !optimize ) test

4 months agocobol/119281 - make sure $(gcc_version) is set for libgcobol install
Richard Biener [Fri, 14 Mar 2025 12:09:31 +0000 (13:09 +0100)] 
cobol/119281 - make sure $(gcc_version) is set for libgcobol install

When using --enable-version-specific-runtime-libs at least it's
required that $(gcc_version) is set to be able to expand
toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'

The following fixes this by adjusting configure.ac to call GCC_BASE_VER
and Makefile.am to include a definition for gcc_version.

libgcobol/
* Makefile.am: Define gcc_version.
* configure.ac: Execute GCC_BASE_VER.
* Makefile.in: Regenerated.
* configure: Likewise.

4 months agoRevert "GCN, nvptx: Basic '__cxa_guard_{acquire,abort,release}' for C++ static local...
Thomas Schwinge [Sat, 23 Dec 2023 10:01:08 +0000 (11:01 +0100)] 
Revert "GCN, nvptx: Basic '__cxa_guard_{acquire,abort,release}' for C++ static local variables support"

GCN, nvptx now has libstdc++-v3/libsupc++ proper.

This reverts commit c0bf7ea189ecf252152fe15134f70f576bcd20b2.

4 months agoGCN, nvptx: Don't default-disable libstdc++ build
Thomas Schwinge [Mon, 11 Jul 2022 20:36:39 +0000 (22:36 +0200)] 
GCN, nvptx: Don't default-disable libstdc++ build

In addition to making libstdc++ itself available, this, via enabling
'build-gcc/*/libstdc++-v3/scripts/testsuite_flags', in particular also makes
the standard C++ headers available to 'make check-gcc-c++'.  With that, there
are a lot of FAIL/UNRESOLVED -> PASS progressions, where we previously ran
into, for example:

    FAIL: g++.dg/coroutines/co-await-syntax-00-needs-expr.C  (test for errors, line 6)
    FAIL: g++.dg/coroutines/co-await-syntax-00-needs-expr.C (test for excess errors)
    Excess errors:
    [...]/gcc/testsuite/g++.dg/coroutines/coro.h:132:10: fatal error: cstdlib: No such file or directory

Similarly, there are a lot of FAIL/UNRESOLVED -> UNSUPPORTED "progressions" due
to 'sorry, unimplemented: exception handling not supported'.

The 'make check-target-libstdc++-v3' results don't look too bad, either.

This also reverts Subversion r221362
(Git commit d94fae044da071381b73a2ee8afa874b14fa3820) "No libstdc++ for nvptx",
and commit 2f4f3c0e9345805160ecacd6de527b519a8c9206 "No libstdc++ for GCN".

With libstdc++ now available, libgrust gets enabled, which we in turn again
have to disable, for 'sorry, unimplemented: exception handling not supported'
reasons.

PR target/92713
PR target/101544
* configure.ac [GCN, nvptx] (noconfigdirs): Don't add
'target-libstdc++-v3'.  Add 'target-libgrust'.
* configure: Regenerate.
gcc/
* config/gcn/gcn.h (LIBSTDCXX): Don't set.
* config/nvptx/nvptx.h (LIBSTDCXX): Likewise.

4 months agoGCN, nvptx: Allow for "hosted" libstdc++ build
Thomas Schwinge [Thu, 20 Feb 2025 15:31:50 +0000 (16:31 +0100)] 
GCN, nvptx: Allow for "hosted" libstdc++ build

We need '-fno-exceptions', '-fno-rtti', disable generation of PCH files, and
for nvptx twiddle some more knobs.

PR target/92713
PR target/101544
libstdc++-v3/
* config/cpu/nvptx/cpu_defines.h: New.
* config/cpu/nvptx/t-nvptx: Likewise.
* configure.host: Handle GCN, nvptx.

4 months agolibstdc++: Include missing algorithm header in priority_queue tests.
Tomasz Kamiński [Fri, 14 Mar 2025 11:42:17 +0000 (12:42 +0100)] 
libstdc++: Include missing algorithm header in priority_queue tests.

libstdc++-v3/ChangeLog:

* testsuite/23_containers/priority_queue/cons_from_range.cc:
Add `#include <algorithm>.
* testsuite/23_containers/priority_queue/members/push_range.cc:
Add `#include <algorithm>.

4 months agotree-optimization/119274 - improve VN optimistic dominance query
Richard Biener [Fri, 14 Mar 2025 09:01:20 +0000 (10:01 +0100)] 
tree-optimization/119274 - improve VN optimistic dominance query

The following improves how VN performs its dominance queries to
determine availability, exploiting edges considered unreachable.
The function already contains code to handle the leader block
forking the CFG, but that looks like a situation that won't
help the dominance query ever.  The following adds handling
of the more useful case where this block forwards to a CFG
merge with the forwarder being the only executable entry.

This helps optimizing the code so the spurious array diagnostic
does no longer appear.

PR tree-optimization/119274
* tree-ssa-sccvn.cc (dominated_by_p_w_unex): Handle the
top block being the only executable forwarder to a CFG
merge.

* g++.dg/opt/pr119274.C: New testcase.

4 months agovect: Fix aarch64/pr99873_2.c ld4/st4 failure
Richard Sandiford [Fri, 14 Mar 2025 10:28:01 +0000 (10:28 +0000)] 
vect: Fix aarch64/pr99873_2.c ld4/st4 failure

vect_slp_prefer_store_lanes_p allows an SLP tree to be split even
if the tree could use store-lanes, provided that one of the new
groups would operate on full vectors for each scalar iteration.
That heuristic is no longer firing for gcc.target/aarch64/pr99873_2.c.

The test contains:

void __attribute ((noipa))
foo (uint64_t *__restrict x, uint64_t *__restrict y, int n)
{
  for (int i = 0; i < n; i += 4)
    {
      x[i] += y[i];
      x[i + 1] += y[i + 1];
      x[i + 2] |= y[i + 2];
      x[i + 3] |= y[i + 3];
    }
}

and wants us to use V2DI for the first two elements and V2DI for
the second two elements, rather than LD4s and ST4s.  This gives:

.L3:
        ldp     q31, q0, [x0]
        add     w3, w3, 1
        ldp     q29, q30, [x1], 32
        orr     v30.16b, v0.16b, v30.16b
        add     v31.2d, v29.2d, v31.2d
        stp     q31, q30, [x0], 32
        cmp     w2, w3
        bhi     .L3

instead of:

.L4:
        ld4     {v28.2d - v31.2d}, [x2]
        ld4     {v24.2d - v27.2d}, [x3], 64
        add     v24.2d, v28.2d, v24.2d
        add     v25.2d, v29.2d, v25.2d
        orr     v26.16b, v30.16b, v26.16b
        orr     v27.16b, v31.16b, v27.16b
        st4     {v24.2d - v27.2d}, [x2], 64
        cmp     x2, x5
        bne     .L4

The first loop only handles half the amount of data per iteration,
but it requires far fewer internal permutations.

One reason the heuristic no longer fired looks like a typo: the call
to vect_slp_prefer_store_lanes_p was passing "1" as the new group size,
instead of "i".

However, even with that fixed, vect_analyze_slp later falls back on
single-lane SLP with load/store lanes.  I think that heuristic too
should use vect_slp_prefer_store_lanes_p (but it otherwise looks good).

The question is whether every load should pass
vect_slp_prefer_store_lanes_p or whether just one is enough.
I don't have an example that would make the call either way,
so I went for the latter, given that it's the smaller change
from the status quo.

This also appears to improve fotonik3d and roms from SPEC2017
(cross-checked against two different systems).

gcc/
* tree-vect-slp.cc (vect_build_slp_instance): Pass the new group
size (i) rather than 1 to vect_slp_prefer_store_lanes_p.
(vect_analyze_slp): Only force the use of load-lanes and
store-lanes if that is preferred for at least one load/store pair.

4 months agolibstdc++: fix compile error when converting std::weak_ptr<T[]>
Giuseppe D'Angelo [Mon, 9 Dec 2024 23:56:13 +0000 (00:56 +0100)] 
libstdc++: fix compile error when converting std::weak_ptr<T[]>

A std::weak_ptr<T[]> can be converted to a compatible
std::weak_ptr<U[]>. This is implemented by having suitable converting
constructors to std::weak_ptr which dispatch to the __weak_ptr base
class (implementation detail).

In __weak_ptr<T[]>, lock() is supposed to return a __shared_ptr<T[]>,
not a __shared_ptr<element_type> (that is, __shared_ptr<T>).

Unfortunately the return type of lock() and the type of the returned
__shared_ptr were mismatching and that was causing a compile error: when
converting a __weak_ptr<T[]> to a __weak_ptr<U[]> through __weak_ptr's
converting constructor, the code calls lock(), and that simply fails to
build.

Fix it by removing the usage of element_type inside lock(), and using
_Tp instead.

Note that std::weak_ptr::lock() itself was already correct; the one in
__weak_ptr was faulty (and that is the one called by __weak_ptr's
converting constructors).

libstdc++-v3/ChangeLog:

* include/bits/shared_ptr_base.h (lock): Fixed a compile error
when calling lock() on a weak_ptr<T[]>, by removing an
erroneous usage of element_type from within lock().
* testsuite/20_util/shared_ptr/requirements/explicit_instantiation/1.cc:
Add more tests for array types.
* testsuite/20_util/weak_ptr/requirements/explicit_instantiation/1.cc:
Likewise.
* testsuite/20_util/shared_ptr/requirements/1.cc: New test.
* testsuite/20_util/weak_ptr/requirements/1.cc: New test.

4 months agotree-optimization/119155 - wrong aligned access for vectorized packed access
Richard Biener [Fri, 7 Mar 2025 11:57:42 +0000 (12:57 +0100)] 
tree-optimization/119155 - wrong aligned access for vectorized packed access

When doing strided SLP vectorization we use the wrong alignment for
the possibly piecewise access of the vector elements for loads and
stores.  While we are carefully using element aligned loads and
stores that isn't enough for the case the original scalar accesses
are packed.  The following instead honors larger alignment when
present but correctly falls back to the original scalar alignment
used.

PR tree-optimization/119155
* tree-vect-stmts.cc (vectorizable_store): Do not always
use vector element alignment for VMAT_STRIDED_SLP but
a more correct alignment towards both ends.
(vectorizable_load): Likewise.

* gcc.dg/vect/pr119155.c: New testcase.

4 months agoDoc: Remove redundant info from documentation of -ansi.
Sandra Loosemore [Wed, 12 Mar 2025 23:36:17 +0000 (23:36 +0000)] 
Doc: Remove redundant info from documentation of -ansi.

The -ansi option has essentially been superseded by the more general
-std= option, and all the additional information about its effects is
already covered elsewhere in the manual.  I also cleaned up some
confusing text about alternate keywords that I noticed while
confirming this.

gcc/ChangeLog
* doc/extend.texi (Alternate Keywords): Clean up text and remove
discussion of "restrict", which is not a GNU extension at all.
* doc/invoke.texi (C Dialect Options): Remove detailed discussion.

4 months agoDaily bump.
GCC Administrator [Fri, 14 Mar 2025 00:17:27 +0000 (00:17 +0000)] 
Daily bump.

4 months agolibstdc++: Work around C++20 tuple<tuple<any>> constraint recursion [PR116440]
Patrick Palka [Thu, 13 Mar 2025 23:55:00 +0000 (19:55 -0400)] 
libstdc++: Work around C++20 tuple<tuple<any>> constraint recursion [PR116440]

The type tuple<tuple<any>> is clearly copy/move constructible, but for
reasons that are not yet completely understood checking this triggers
constraint recursion with our C++20 tuple implementation (but not the
C++17 implementation).

It turns out this recursion stems from considering the non-template
tuple(const _Elements&) constructor during the copy/move constructibility
check.  Considering this constructor is ultimately redundant, since the
defaulted copy/move constructors are better matches.

GCC has a non-standard "perfect candidate" optimization[1] that causes
overload resolution to shortcut considering template candidates if we
find a (non-template) perfect candidate.  So to work around this issue
(and as a general compile-time optimization) this patch turns the
problematic constructor into a template so that GCC doesn't consider it
when checking for copy/move constructibility of this tuple type.

Changing the template-ness of a constructor can affect overload
resolution (since template-ness is a tiebreaker) so there's a risk this
change could e.g. introduce overload resolution ambiguities.  But the
original C++17 implementation has long defined this constructor as a
template (in order to constrain it etc), so doing the same thing in the
C++20 mode should naturally be quite safe.

The testcase still fails with Clang (in C++20 mode) since it doesn't
implement said optimization.

[1]: See r11-7287-g187d0d5871b1fa and
https://isocpp.org/files/papers/P3606R0.html

PR libstdc++/116440

libstdc++-v3/ChangeLog:

* include/std/tuple (tuple::tuple(const _Elements&...))
[C++20]: Turn into a template.
* testsuite/20_util/tuple/116440.C: New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
4 months agoPlug small loophole in the pattern matching done by -fdump-ada-spec
Eric Botcazou [Thu, 13 Mar 2025 23:01:46 +0000 (00:01 +0100)] 
Plug small loophole in the pattern matching done by -fdump-ada-spec

gcc/c-family/
PR ada/119265
* c-ada-spec.cc (dump_ada_node) <INTEGER_TYPE>: Deal with typedefs
of unsigned __int128.

4 months agoUpdate gcc de.po
Joseph Myers [Thu, 13 Mar 2025 23:01:25 +0000 (23:01 +0000)] 
Update gcc de.po

* de.po: Update.

4 months agoFix speculation_useful_p
Jan Hubicka [Thu, 13 Mar 2025 19:11:02 +0000 (20:11 +0100)] 
Fix speculation_useful_p

This patch fixes issue with speculation and x264.  With profile feedback
we first introduce speculative calls to mc_chroma which is called indirectly.
Then we propagate constants acorss these calls (which is useful transform) but
then speculation_useful_p decides that these speculations are not useful and
we end up calling unspecialized version.

This patch updates speculation_useful_p to consider edges redirected earlier
to clones as useful, since we can expect that ipa-cp knows what it is doing
(originally it only looked for inlined calls).  I also noticed that we want
to keep edges even if they are not hot.

Finally I noticed a typo in computing target in code which intends to keep
devirtualized calls to functions where we propagated pureness/constness. Newly
we also track ipa-modref summaries as they also may be useful.

gcc/ChangeLog:

PR ipa/119147
* ipa-inline.cc: Include ipa-modref-tree.h and
ipa-modref.h.
(speculation_useful_p): If target is a clone, speculation is usef;
fix mixup of caller and callee; speculate also calls not considered
hot; consider modref summary also possibly useful for optimization.
* ipa-profile.cc (ipa_profile): Keep non-hot speculations.

4 months agoFortran: improve checking of substring bounds [PR119118]
Harald Anlauf [Thu, 13 Mar 2025 17:46:54 +0000 (18:46 +0100)] 
Fortran: improve checking of substring bounds [PR119118]

Commit r15-7873 copy-pasted erroneous code containing a non-terminating
loop that did not progress its control variable, and a switch statement
with an unhandled case leading to a gcc_unreachable () with suitable input.

PR fortran/119118

gcc/fortran/ChangeLog:

* dependency.cc (contains_forall_index_p): Let loop over elements
of a constructor update its control variable.  Handle REF_INQUIRY
in switch statement.
(gfc_contains_implied_index_p): Likewise.

gcc/testsuite/ChangeLog:

* gfortran.dg/bounds_check_26.f90: Update test.

4 months agolibstdc++: Add P1206R7 from_range members to container adaptors [PR111055]
Jonathan Wakely [Tue, 8 Oct 2024 20:15:18 +0000 (21:15 +0100)] 
libstdc++: Add P1206R7 from_range members to container adaptors [PR111055]

This is another piece of P1206R7, adding new members to std::stack,
std::queue, and std::priority_queue.

PR libstdc++/111055

libstdc++-v3/ChangeLog:

* include/bits/stl_queue.h (queue(from_range_t, _Rg&&))
(queue(from_range_t, _Rg&&, const _Alloc&), push_range):
Define.
(priority_queue(from_range_t, R&&, const Compare&))
(push_range): Define.
* include/bits/stl_stack.h (stack(from_range_t, R&&))
(stack(from_range_t, R&&, const Alloc&), push_range): Define.
* testsuite/util/testsuite_iterators.h (test_range_nocopy): Define.
* testsuite/23_containers/priority_queue/cons_from_range.cc: New test.
* testsuite/23_containers/priority_queue/members/push_range.cc: New test.
* testsuite/23_containers/queue/cons_from_range.cc: New test.
* testsuite/23_containers/queue/members/push_range.cc: New test.
* testsuite/23_containers/stack/cons_from_range.cc: New test.
* testsuite/23_containers/stack/members/push_range.cc: New test.

Co-authored-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 months agotestsuite, gm2: Use -B option for libstdc++ where required.
Iain Sandoe [Mon, 10 Mar 2025 08:44:41 +0000 (08:44 +0000)] 
testsuite, gm2: Use -B option for libstdc++ where required.

We need to add testsuite  options to locate gm2 libs and libstdc++.

Usually '-L' options are added to point to the relevant directories for
the uninstalled libraries.

In cases where libraries are available as both shared and convenience some
additional checks are made.

For some targets -static-xxxx options are handled by specs substitution and
need a '-B' option rather than '-L'.  For Darwin, when embedded runpaths are
in use (the default for all versions after macOS 10.11), '-B' is also needed
to provide the runpath.

When '-B' is used, this results in a '-L' for each path that exists (so that
appending a '-L' as well is a needless duplicate).  There are also cases
where tools warn for duplicates, leading to spurious fails.

Therefore the objective of the code here is to add just one '-L' or '-B' for
each of the libraries.

Currently, we are forcing the full paths to each of the gm2 convenience libs
onto the link line and therefore the B/L logic is not needed there.  It would
need to be added if/when gm2 is tested with shared libraries

gcc/testsuite/ChangeLog:

* lib/gm2.exp: Arrange for a '-B' option to be added for the
libstdc++ paths on targets that need it.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
4 months agotestsuite: Fix sve/mask_struct_load_3_run.c [PR113965]
Richard Sandiford [Thu, 13 Mar 2025 15:13:00 +0000 (15:13 +0000)] 
testsuite: Fix sve/mask_struct_load_3_run.c [PR113965]

Among other things, this testcase tests an addition of the four
values (n*4+[0:3])*9//2 for each n in [0:99].  The addition is
done in multiple integer and floating-point types and the test
is compiled with -ffast-math.

One of the floating-point types is _Float16, and as Andrew says
in the PR, _Float16's limited precision means that the order of the
additions begins to matter for higher n.  Specifically, some orders
begin to give different results from others at n=38, and at many
higher n as well.

This patch uses 5/3 rather than 9/2.  I tested locally that
all addition orders give the same result over the test range.

gcc/testsuite/
PR testsuite/113965
* gcc.target/aarch64/sve/mask_struct_load_3_run.c: Use an
input range that is suitable for _Float16.

4 months agolibstdc++: Implement <stdckdint.h> for C++26 (P3370R1)
Jonathan Wakely [Thu, 13 Mar 2025 14:10:00 +0000 (14:10 +0000)] 
libstdc++: Implement <stdckdint.h> for C++26 (P3370R1)

This is the second part of the P3370R1 proposal just approved by the
committee in Wrocław. This adds C++ equivalents of the functions added
to C23 by WG14 N2683.

These functions are in the global namespace, but to avoid collisions
with the same functions defined by other standard library
implementations, this change defines them in namespace __gnu_cxx and
then adds them to the global namespace.

libstdc++-v3/ChangeLog:

* include/Makefile.am: Add stdckdint.h.
* include/Makefile.in: Regenerate.
* src/c++23/std.compat.cc.in: Export <stdckdint.h> functions.
* include/c_compatibility/stdckdint.h: New file.
* testsuite/26_numerics/stdckdint/1.cc: New test.
* testsuite/26_numerics/stdckdint/2_neg.cc: New test.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
4 months agolibstdc++: Implement <stdbit.h> for C++26 (P3370R1)
Jonathan Wakely [Thu, 13 Mar 2025 13:34:55 +0000 (13:34 +0000)] 
libstdc++: Implement <stdbit.h> for C++26 (P3370R1)

This is the first part of the P3370R1 proposal just approved by the
committee in Wrocław. This adds C++ equivalents of the functions added
to C23 by WG14 N3022.

These functions are in the global namespace, but to avoid collisions
with the same functions defined by other standard library
implementations, this change defines them in namespace __gnu_cxx and
then adds them to the global namespace.

libstdc++-v3/ChangeLog:

* include/Makefile.am: Add stdbit.h.
* include/Makefile.in: Regenerate.
* src/c++23/std.compat.cc.in: Export <stdbit.h> functions.
* include/c_compatibility/stdbit.h: New file.
* testsuite/20_util/stdbit/1.cc: New test.
* testsuite/20_util/stdbit/2_neg.cc: New test.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
4 months agoHonor prefix and suffix when installing cobol binaries and man page.
Matthias Klose [Thu, 13 Mar 2025 14:38:53 +0000 (15:38 +0100)] 
Honor prefix and suffix when installing cobol binaries and man page.

2025-03-13  Matthias Klose  <doko@ubuntu.com>

gcc/cobol/
* Make-lang.in (cobol.install-common, cobol.install-man): Honor
GCOBOL_INSTALL_NAME.

4 months agoFixup DECL_NOT_GIMPLE_REG_P description
Richard Biener [Thu, 13 Mar 2025 14:11:08 +0000 (15:11 +0100)] 
Fixup DECL_NOT_GIMPLE_REG_P description

When I changed DECL_GIMPLE_REG_P over to DECL_NOT_GIMPLE_REG_P I
failed to update its description.

* tree.h (DECL_NOT_GIMPLE_REG_P): Update description.